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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tai42_contract-6.0.0.tar.gz.
File metadata
- Download URL: tai42_contract-6.0.0.tar.gz
- Upload date:
- Size: 167.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef52dc1b7c38301718d76e05999ec4154ccee0ddc5cf35367536b44d78ef4623
|
|
| MD5 |
77cafe54a2ff9548223527400a9374ee
|
|
| BLAKE2b-256 |
bb62eccdd1683999e461a5ac7a2f86bcf2886e9444df593730e481f3850786de
|
File details
Details for the file tai42_contract-6.0.0-py3-none-any.whl.
File metadata
- Download URL: tai42_contract-6.0.0-py3-none-any.whl
- Upload date:
- Size: 203.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db378668e7a4a004fea47eae6e30e2fd86f151722c5b10dc7b4c855dea4bfa99
|
|
| MD5 |
159b3965de81e7f9ac5c7227335fdfab
|
|
| BLAKE2b-256 |
da9df876b31b63b5a6c8ca346ddfc50028c4ab720ddd6aee0d936b0e401ee3d6
|