Metadata-Version: 2.4
Name: ccp-sdk
Version: 0.1.0
Summary: Reference Python SDK for Cortex Capsule Protocol (CCP)
Author: CCP contributors
License: MIT License
        
        Copyright (c) 2026 Jonathan Hidalgo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/<your-org>/<your-repo>
Project-URL: Repository, https://github.com/<your-org>/<your-repo>
Keywords: ccp,protocol,iot,robotics,gateway
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 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Requires-Dist: jsonschema>=4.21
Dynamic: license-file

# CCP
Cortex Capsule Protocol (CCP) — v0.1 Draft

CCP standardizes communication between devices (robots, microcontrollers, gateways) and Cortex Capsule servers (local or cloud brain runtime).

## Contents
- Core specification
- HTTP mapping
- JSON schemas
- Message examples

## Structure
- [docs/](docs/README.md)
- [schemas/](schemas)
- [examples/](examples)

## Get started
1. Read the core spec: [docs/spec/ccp-core.md](docs/spec/ccp-core.md)
2. Check HTTP mapping: [docs/spec/http-binding.md](docs/spec/http-binding.md)
3. See schemas: [docs/spec/message-schemas.md](docs/spec/message-schemas.md)
4. See examples: [examples/](examples)

## How to use CCP
- This repo is the **specification**, not a dependency to install.
- Projects should depend on a **CCP SDK** (language/runtime specific) that implements the protocol.
- If you need JSON schemas in production, the SDK should bundle them or reference a published schema package.

## Python SDK (reference)

This repository now includes a minimal reference Python SDK that you can install with pip.

### Install (local dev)
From the repo root:

```bash
python -m pip install -e .
```

### Install (from PyPI)
After you publish it:

```bash
python -m pip install ccp-sdk
```

### Usage
See a runnable example in [examples/python_client.py](examples/python_client.py).

If your ESP32 sends data to a Python gateway API, see: [examples/esp32_gateway_api/](examples/esp32_gateway_api/).

## ESP32 note
ESP32 (Arduino/ESP-IDF) does not run `pip` packages directly.

Typical architecture:
- ESP32 handles hardware (mic/speaker/LED/display) and sends events/audio to a gateway over Wi-Fi/serial.
- The gateway (Raspberry Pi / PC) runs the Python CCP SDK and talks to the CCP server over HTTP.

Practical mapping:
- Mic (I2S) -> capture audio -> upload to `/v1/media/audio` -> send `turn` with `audio_ref`
- Speaker (I2S) <- receive `turn_result.payload.reply.audio_ref` -> download audio -> play
- LED strip / display <- drive UI based on `turn_result.payload.state`, `safety`, or `actions`

## SDKs (planned)
- `ccp-python` — reference SDK for capsules/gateways
- `ccp-esp32` — thin device SDK for microcontrollers

## Version
CCP v0.1 (Draft)

## Roadmap
See [docs/roadmap.md](docs/roadmap.md).

## Community
Discord: invite link TBD.

## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for how to propose changes and submit PRs.

## Code of Conduct
See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).

## Security
See [SECURITY.md](SECURITY.md).
