Metadata-Version: 2.4
Name: nex-protocol
Version: 0.1.0a2
Summary: Nex: a deterministic language and protocol for agent understanding and alignment.
Author: Nex Project contributors
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jsonschema>=4.18
Requires-Dist: cryptography>=42
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-cov>=4; extra == "dev"
Requires-Dist: hypothesis>=6; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# Nex

A deterministic language and protocol for agent understanding and alignment.

**Status: alpha (0.1.0a2).** This repository is the Nex Alpha 1.0 reference protocol and runtime.
It is a pre-release published to PyPI as `nex-protocol` (`pip install nex-protocol==0.1.0a2`; import name `nex`). The quantum-related and network features are out of scope.

## Quick start

```
pip install nex-protocol==0.1.0a2
# or, for development:
pip install -e ".[dev]"
pytest
nex demo                          # signed two-agent handshake + request
nex glyph Kamyar --format svg -o kamyar.svg    # Nex-G glyph (also json | png | scene | html)
nex glyph Kamyar --format html -o kamyar.html  # self-contained 3D preview (open in a browser)
nex glyph Kamyar --format png -o kamyar.png     # PNG is written as raw bytes; use -o on Windows
nex glyph Kamyar --glyph-version 1.0            # frozen 1.0 algorithm (default is 1.1)
nex error E709                    # describe an error code
python benchmarks/bench.py        # simple benchmarks
```

## What is implemented

- **Nex-J / Nex-T** parsing, strict JSON-Schema validation (cached validators), RFC 8785-style canonical JSON.
- **Runtime**: handshake, sessions, Ed25519 signatures, nonce/replay protection, duplicate-id detection,
  task state machine, error registry (E-codes) and ERROR responses, memory and SQLite stores, cleanup worker.
- **Nex-G**: deterministic integer-only glyph geometry, SVG, PNG, and a deterministic **3D scene description**.
- **Experimental (non-normative)**: ultrasonic symbol encoding, [NEP-0007](spec/NEP-0007-Ultrasonic-Symbols.md).
  It never changes Nex-J, which stays canonical.
- **Crypto agility**: documented in [NEP-0002](spec/NEP-0002-Nex-Protocol-1.1.md), including a reserved slot for a
  future post-quantum signature algorithm. No post-quantum or quantum features are implemented.

## Layout

- `src/nex/` - reference implementation
- `schemas/` - JSON schemas and registries (packaged with the wheel)
- `spec/` - Nex Enhancement Proposals (NEP-0001 .. NEP-0007)
- `docs/` - [Final specification](docs/NEX_FINAL_SPEC.md), [Master handoff](docs/MASTER_HANDOFF.md),
  [Images note](docs/IMAGES_NOTE.txt), [Releasing](docs/RELEASING.md)
- `tests/`, `benchmarks/`, `examples/`

See [CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md) and [CHANGELOG.md](CHANGELOG.md).
