Metadata-Version: 2.3
Name: etaoi-schema
Version: 0.5.0
Summary: Shared wire schema for VIZ (Pydantic v2 source of truth)
Keywords: agentviz,schema,pydantic,msgpack,wire-format
Author: AAIRA / VIZ contributors
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: pydantic>=2.13,<3
Requires-Dist: msgpack>=1.1.2,<2 ; extra == 'msgpack'
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/agentviz/agentviz
Project-URL: Repository, https://github.com/agentviz/agentviz
Provides-Extra: msgpack
Description-Content-Type: text/markdown

# agentviz-schema (Python)

Shared wire schema for [VIZ](../../../README.md) — the Pydantic v2 source of truth for
every type that crosses the SDK / server / UI boundary.

This package is consumed by:

- [`agentviz`](../../agentviz/) — Python SDK that streams telemetry over WebSocket
- [`agentviz-server`](../../agentviz-server/) — FastAPI backend that persists events
  to ClickHouse and fans them out over SSE
- [`agentviz-ui`](../../agentviz-ui/) — Next.js UI (via the TypeScript mirror in
  [`../typescript/`](../typescript/))

The TypeScript mirror in `../typescript/` is hand-maintained from this source.
A CI msgpack-roundtrip parity test (Phase 1 Plan 07) prevents drift.

## Public surface

```python
from agentviz_schema import (
    # Core domain
    Session, Trace, Span,
    # Events (discriminated union on `kind`)
    SpanStartEvent, SpanDeltaEvent, SpanEndEvent, Event,
    # Envelope (D-04)
    Envelope,
    # Handshake (D-06)
    Hello, Welcome, MismatchError,
    # Versioning policy (D-05)
    is_major_compatible,
    # Constants
    SCHEMA_VERSION,
    WS_CLOSE_SCHEMA_MISMATCH,    # 4400
    SSE_MISMATCH_HTTP_STATUS,    # 426
)
```

See [`CONTRIBUTING.md`](../CONTRIBUTING.md) for the additive-only-within-major
versioning policy.
