Metadata-Version: 2.4
Name: cellflow
Version: 0.8.0
Summary: Cell+Flow protocol as a pure Python library — persistent memory, earned trust (IF/Karma), discovery, and Agent collaboration. Zero MCP dependency; cellflow-mcp is the MCP skin on top.
Author: Jerry G
License: MIT
Project-URL: Homepage, https://github.com/gonzalescatalino663-art/cellflow
Project-URL: Repository, https://github.com/gonzalescatalino663-art/cellflow
Project-URL: Issues, https://github.com/gonzalescatalino663-art/cellflow/issues
Keywords: ai-agent,cellflow,memory,trust,karma,reputation,decentralized,protocol
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.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0

# cellflow

**Cell+Flow protocol as a pure Python library.** Zero MCP dependency — no
server to start, no MCP host required. [`cellflow-mcp`](../mcp) is the MCP
transport skin on top of this library (SPEC §10: transport-agnostic —
protocol capability = library; MCP is just one skin).

```bash
pip install cellflow
```

```python
from cellflow import CellFlow

cf = CellFlow(storage_path="./my_data")           # local SQLite, no server
cell = cf.cell_register(schema_type="agent.v1", genome={"name": "my agent"})
cf.flow_capture(topic="test", content="hello")
print(cf.calculate_if(cell["cell_id"]))           # IF: earned trust, 0-100
```

## Layout (mirrors the protocol)

| Module | What lives there |
|---|---|
| `cellflow.core` | cell_register / cell_get / export / import / lifecycle |
| `cellflow.flow` | flow_capture / flow_recall / flow_list / flow_delete |
| `cellflow.history` | hash-chain verify_history |
| `cellflow.trust` | calculate_if / karma (three hard gates + four weights) |
| `cellflow.discover` | discover_agents (exploration quota) / dht_announce |
| `cellflow.divide` | divide_create / divide_parallel / backflow_experience |
| `cellflow.comms` | send_flow / pull_inbox (endpoint-direct + DHT relay) |
| `cellflow.identity` | Ed25519 identity_create / identity_verify |
| `cellflow.task_market` | publish_task / accept_task / deliver_task |
| `cellflow.audit` `.penalty` `.witness` | anti-cheat machinery |
| `cellflow.shadow` | shadow Cells (passive infection + claim) |
| `cellflow.email_bridge` `.protocol_bridge` | email / A2A / MCP / HTTP → Flow |
| `cellflow.storage` | SQLite backend (injectable — see below) |

Deeper internals stay importable at `cellflow.modules.*` (e.g.
`cellflow.modules.karma`) — same modules, one physical copy.

## Injectable storage (P2)

Default is local SQLite. Pass any object implementing the `Storage`
duck-type (`read / write / append / delete / search / upsert`):

```python
cf = CellFlow(storage=MyCustomStorage())
```

Or migrate existing SPEC-shaped data losslessly:

```python
cf.cell_import({"cells": [...], "flows": [...]})   # SPEC §1/§2 field layout
```

## Relationship to cellflow-mcp

`cellflow-mcp` depends on this package and only adds the 56 `@mcp.tool()`
pass-throughs, the CLI, and the HTTP facade. All protocol behaviour —
IF/Karma math, hash chains, discovery ranking, bridges — lives here and is
identical through every transport.

MIT License · Python 3.10+ · [SPEC](../../cellflow-protocol/SPEC.md) is the
authoritative source.
