Skip to main content

tai42-contract

License: Apache 2.0

Pure interface contracts for the TAI ecosystem: the protocols, ABCs, pydantic models, and enums every other package builds against. At runtime this package imports nothing but pydantic, and its behaviour is limited to a narrow whitelisted surface — the tai42_app forwarding handle, model-level validators/normalizers, the bind/read/reset accessors of the ambient run context variables, the storage path guard, and Agent's default astream/terminal-drain with its park conversion SuspendedFinal.to_suspended_interaction; everything else is a pydantic model, Protocol, ABC, or enum. Logic over this vocabulary that plugins, engines and the server share lives in tai42-kit: park adoption and the chained-call notices (tai42_kit.interactions.park_adoption), the park marker builder and reader (park_marker), the whole-chain kill handlers (park_kill), the failed-outcome text (outcome_text), and the inbound-media turn shaping and entry-params policy (tai42_kit.conversations.inbound_media, tai42_kit.conversations.entry_params). Vendor types (fastmcp, starlette, mcp) appear only inside TYPE_CHECKING blocks, so they are never loaded when the code runs.

Position in the ecosystem

TAI is an open-source runtime for MCP tools, agents, and workflows — the server that hosts a capability and supplies the operational layer around it (manifest loading, access control, OAuth connectors, background execution, monitoring, storage, and human-in-the-loop steps). Everything plugs in against the interfaces this package defines.

Four packages; each depends only on the ones to its left:

                     tai42-kit  <--.
                   /  (helpers)     \
tai42-contract  <-+                  +--  tai42-skeleton
  (interfaces)     \                /    (the server)
                     tai42-cli  <--'
               (the remote client)

tai42-contract is the leaf: it depends on no other tai-* package, so anything — the skeleton, the CLI, a plugin, a helper — can import it without pulling in an implementation.

Install

Requires Python 3.13+. Install from PyPI into the environment that runs the server. Usually pulled in transitively via tai42-kit / tai42-skeleton, but it installs directly too:

uv add tai42-contract

Or from source — clone this repo and add it as an editable dependency:

git clone https://github.com/tai42ai/tai42   # next to your app checkout
cd /path/to/your/app
uv add --editable ../tai42/core/contract

Development

uv venv --python 3.13
uv pip install --no-sources --editable ".[dev]"   # pydantic + tooling + vendor libs (for pyright)
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync pyright
uv run --no-sync pytest --cov --cov-report=term-missing                           # self-contained contract tests

Documentation

The whole platform — concepts, guides, and the generated reference — lives in the unified documentation site:

License

Apache-2.0. See LICENSE and NOTICE.

Metadata

Release files for tai42-contract 19.4.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 tai42-contract 19.4.0
File Size Uploaded
tai42_contract-19.4.0.tar.gz 330.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tai42-contract 19.4.0
File Interpreter ABI Platform
tai42_contract-19.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 735.3 kB

Release files / tai42_contract-19.4.0.tar.gz

Download URL tai42_contract-19.4.0.tar.gz
Size 330.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f5dd56da4f0ebf003eaf2c6e4519de5539cc8b9b21c40cd7a694d10e01b3772e
BLAKE2b-256 checksum
How to use checksums
3ac5e429a91f9793ae3ce64716ad52090ea60e30dc6abef3f3c233b82a52d13d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tai42_contract-19.4.0-py3-none-any.whl

Download URL tai42_contract-19.4.0-py3-none-any.whl
Size 404.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6001a3b88b95014cc161cc3e53a93ecf3565551893246350ff7dde092a2b98b5
BLAKE2b-256 checksum
How to use checksums
82d8abc92588c02bb2295a7b51fff2a296106ab419b1c35021ea7cb4f0d0485f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

19.4.0 This release

2 release files

19.3.0

2 release files

19.2.0

2 release files

19.1.0

2 release files

19.0.0

2 release files

18.0.0

2 release files

17.0.0

2 release files

15.3.0

2 release files

15.2.0

2 release files

15.1.0

2 release files

15.0.1

2 release files

15.0.0

2 release files

14.0.0

2 release files

13.2.0

2 release files

13.1.0

2 release files

13.0.0

2 release files

12.0.0

2 release files

11.0.1

2 release files

11.0.0

2 release files

10.0.0

2 release files

9.0.1

2 release files

9.0.0

2 release files

8.2.1

2 release files

8.2.0

2 release files

8.1.0

2 release files

8.0.0

2 release files

7.1.0

2 release files

7.0.2

2 release files

7.0.1

2 release files

7.0.0

2 release files

6.5.0

2 release files

6.4.0

2 release files

6.3.0

2 release files

6.2.0

2 release files

6.1.0

2 release files

6.0.2

2 release files

6.0.1

2 release files

6.0.0

2 release files

5.9.0

2 release files

5.8.0

2 release files

5.7.0

2 release files

5.6.0

2 release files

5.5.0

2 release files

5.4.0

2 release files

5.3.0

2 release files

5.2.0

2 release files

5.1.0

2 release files

5.0.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.0.0

2 release files

2.3.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.4.1

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

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