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 29.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 29.4.0
File Size Uploaded Provenance Actions
tai42_contract-29.4.0.tar.gz 377.8 kB Without provenance Details for tai42_contract-29.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 838.9 kB

Release files / tai42_contract-29.4.0.tar.gz

Download URL tai42_contract-29.4.0.tar.gz
Size 377.8 kB
Tags Source
SHA-256 checksum
How to use checksums
986bea00010909c98b622771653b13a542cb3e01a0d46554cb4e9bb07aadc7e3
BLAKE2b-256 checksum
How to use checksums
ac31804fb690cb3a48d0600e98a46921ed4030d615757ac5b1d5dd130b1b2809
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL tai42_contract-29.4.0-py3-none-any.whl
Size 461.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2bc3d5a9136ecb04c724df598ffe224bde5e16648441b9e4920307c5027859a
BLAKE2b-256 checksum
How to use checksums
09135637ab47d6072f1a90c28d0d811f946a214a15eeff8ce8f41a4678f99865
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for tai42-contract 29.4.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

29.4.0 This release

2 release files No provenance

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