Skip to main content

tai42-storage-s3

CI License: Apache 2.0

An S3 Storage backend for the TAI ecosystem. It stores text, binary, and media content in an S3 bucket, implementing the full tai42_contract.storage.Storage surface — the five text methods (load / list / upload / delete / delete_dir) plus the binary/media methods (load_bytes / upload_bytes / stat). S3 stores bytes natively, so the binary methods are true reads/writes rather than the text bridge.

The TAI ecosystem

TAI is an open-source runtime for MCP tools, agents, and workflows. A Storage backend is "where content physically lives" — a pluggable provider the runtime's ResourceManager loads and renders content over. This package is one such provider (S3); siblings back the same contract with GitHub or the local filesystem. The ecosystem is open-ended: any package can back the same contract, so this repo is this provider's own full doc home, and the documentation site covers the platform-level story:

Its only tai-* dependencies are tai42-contract (the Storage ABC, ObjectStat, assert_not_root, and the tai42_app handle) and tai42-kit (PooledClient, TaiBaseSettings, and the settings cache). Beyond those it depends on its S3 driver (aioboto3, botocore) and pydantic / pydantic-settings.

Install

Requires Python 3.13+. Install from PyPI into the environment that runs the server:

uv add tai42-storage-s3

Or from source — clone this repo and add it as an editable dependency. Clone tai-contract and tai-kit beside this repo first — [tool.uv.sources] resolves them from sibling paths.

git clone https://github.com/tai42ai/tai-storage-s3   # next to your app checkout
cd /path/to/your/app
uv add --editable ../tai-storage-s3

Discovery

The skeleton discovers this backend by importing its package — importing tai42_storage_s3 fires the @tai42_app.storage.register_storage decorator on S3Storage as a side-effect (there is no entry-point). Name the package in your manifest's storage_module field so the runtime imports it at startup:

storage_module: tai42_storage_s3

Configuration

Settings are read from the STORAGE_S3_ environment group (see S3Settings):

Env var Default Purpose
STORAGE_S3_BUCKET Target bucket (required)
STORAGE_S3_ENDPOINT Custom endpoint (e.g. MinIO); scheme inferred from SECURE if omitted
STORAGE_S3_ACCESS_KEY AWS access key id
STORAGE_S3_SECRET_KEY AWS secret access key
STORAGE_S3_SECURE true Use HTTPS
STORAGE_S3_REGION us-east-1 AWS region
STORAGE_S3_VERIFY_SSL true Verify TLS certificates
STORAGE_S3_CONNECT_TIMEOUT 5 Connect timeout (seconds)
STORAGE_S3_READ_TIMEOUT 30 Read timeout (seconds)
STORAGE_S3_ADDRESSING_STYLE auto path / virtual / auto
STORAGE_S3_REQUEST_CHECKSUM_CALCULATION when_supported / when_required

Content-type behavior

  • upload (text) stores ContentType: application/jinja2 — a template reads back as its authoring format, not an inferred text/*.
  • upload_bytes stores the parametrized content_type as the object's ContentType (omitted when None).
  • stat returns the object's stored ContentType via head_object, mapping a missing object (404) to FileNotFoundError — no raw ClientError or metadata leaks. Because text uploads store application/jinja2, stat on a text template reports that type; it reads as non-media, which is the only thing the content-type gates.

Development

uv venv --python 3.13
uv pip install --no-sources --group dev --editable .
uv run --no-sync pytest --cov --cov-report=term-missing
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync pyright

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

tai42_storage_s3-0.2.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tai42_storage_s3-0.2.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file tai42_storage_s3-0.2.0.tar.gz.

File metadata

  • Download URL: tai42_storage_s3-0.2.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for tai42_storage_s3-0.2.0.tar.gz
Algorithm Hash digest
SHA256 31697d93dcaa81caa2c8ec1ee331f33d8244b03b07f7517e8e69756a308876e7
MD5 ac570329f1174b152299acda3c23187b
BLAKE2b-256 ddbfd36b10de5948bdc20259850546345084ed52861fe33ed6e8b118872fd9ca

See more details on using hashes here.

File details

Details for the file tai42_storage_s3-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tai42_storage_s3-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77bdc7db6bbea8d8debb88312e2538b93fd95898007487a2e7c5ad3d55382528
MD5 7c3683d0114429841be1b1d7ab64257f
BLAKE2b-256 d83829173a28ce0b9ce0ba8f7b1b7bc0345f430538c7a9517f3cddb4f95a4ba7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page