Metadata-Version: 2.4
Name: agent-cid
Version: 0.1.0
Summary: Content-addressed artifact manifest for AI agents (Python port of @p-vbordei/agent-cid)
Project-URL: Homepage, https://github.com/p-vbordei/agent-cid-py
Project-URL: Reference, https://github.com/p-vbordei/agent-cid
Author-email: Vlad Bordei <bordeivlad@gmail.com>
License: Apache-2.0
License-File: LICENSE
Keywords: agent,cid,did,ed25519,jcs,manifest,multiformats,rfc8785
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.10
Requires-Dist: base58>=2.1
Requires-Dist: cryptography>=42.0
Requires-Dist: httpx>=0.27
Requires-Dist: jcs>=0.2.1
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# agent-cid (Python)

[![CI](https://github.com/p-vbordei/agent-cid-py/actions/workflows/ci.yml/badge.svg)](https://github.com/p-vbordei/agent-cid-py/actions/workflows/ci.yml)
[![License](https://img.shields.io/badge/license-Apache%202.0-green)](./LICENSE)

> **Python port of [`@p-vbordei/agent-cid`](https://github.com/p-vbordei/agent-cid).** Content-addressed artifact manifest for AI agents — CIDv1 + Ed25519 + DID + RFC 8785 JCS. Byte-deterministic-compatible with the TypeScript reference: passes the same C1–C5 conformance vectors.

## Install

```bash
pip install agent-cid
```

## Usage

```python
import asyncio
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from agent_cid import build, verify, pubkey_to_did_key, BuildOpts, SignerInput

async def main():
    priv = Ed25519PrivateKey.generate()
    pub = priv.public_key().public_bytes(
        serialization.Encoding.Raw, serialization.PublicFormat.Raw,
    )
    did = pubkey_to_did_key(pub)

    manifest = await build(
        b"hello world",
        BuildOpts(
            producer_did=did,
            schema_uri="https://example.org/schema",
            media_type="text/plain",
            signers=[SignerInput(did=did, sign_fn=lambda b: priv.sign(b))],
        ),
    )
    r = await verify(manifest, b"hello world")
    print(r.ok)  # True

asyncio.run(main())
```

## Conformance

```bash
pip install -e ".[dev]"
pytest -v
```

Vectors in `vectors/` are copied verbatim from the [TS conformance suite](https://github.com/p-vbordei/agent-cid/tree/main/conformance/vectors).

## License

Apache-2.0
