tai42-contract
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 storage path guard, and Agent's default
astream/terminal-drain; everything else is a pydantic model, Protocol, ABC, or
enum. Vendor types (fastmcp, langchain, 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:
- Layering & the contract/kit/cli/skeleton split: https://tai42.ai/concepts/layering
- Python SDK reference (this package's public API): https://tai42.ai/reference/python-sdk
License
Apache-2.0. See LICENSE and NOTICE.
Release files for tai42-contract 11.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tai42_contract-11.0.0.tar.gz | 244.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tai42_contract-11.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 531.8 kB
Release files / tai42_contract-11.0.0.tar.gz
| Download URL | tai42_contract-11.0.0.tar.gz |
|---|---|
| Size | 244.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c4f6358599ab8a9e58f8f87c4cb5b6897882eba261882ae0fba6178a63d1379
|
|
BLAKE2b-256 checksum How to use checksums |
e613bf30c4a97be7f62aa94b8e8ba4581de21e4db05983d115b68fb5aa12a6ee
|
| 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-11.0.0-py3-none-any.whl
| Download URL | tai42_contract-11.0.0-py3-none-any.whl |
|---|---|
| Size | 286.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c1dce64cace6f3ed61c09d0f23f45c10835358411beb2fed6ef02a6cc5eb7d0
|
|
BLAKE2b-256 checksum How to use checksums |
d674609b67cd3a03240e2bb069f8039f2d0ce3b7b3952da43ab75b2994ab0c4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|