Metadata-Version: 2.4
Name: zerolock-sdk
Version: 0.1.0b1
Summary: Python client SDK for ZeroLock - concurrency-correctness substrate for multi-agent AI systems
License: Apache-2.0
License-File: LICENSE
Keywords: zerolock,multi-agent,ai-agents,concurrency,crdt
Author: ZeroLock Team
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: License :: OSI Approved :: Apache Software 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: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Typing :: Typed
Requires-Dist: httpx (>=0.28.0,<0.29.0)
Requires-Dist: websockets (>=13.0,<14.0)
Project-URL: Homepage, https://zlock-eight.vercel.app
Description-Content-Type: text/markdown

# ZeroLock Python SDK

Python client SDK for ZeroLock - concurrency-correctness substrate for multi-agent AI systems.

## Installation

```bash
pip install --pre zerolock-sdk     # pre-release (beta)
```

## Usage

### Async Client

```python
from zerolock_sdk import ZeroLockClient, CreateShardOptions

async with ZeroLockClient(gateway="http://localhost:8080") as client:
    # Create a shard
    await client.create_shard("my-shard", CreateShardOptions(type="decision"))

    # Read a shard
    shard = await client.get_shard("my-shard")
    print(f"Value: {shard.value}, Version: {shard.version}")

    # Commit a new value
    result = await client.commit_shard("my-shard", "new-value", shard.version)
    print(f"New version: {result.version}")
```

### Sync Client

```python
from zerolock_sdk import ZeroLockSyncClient, CreateShardOptions

with ZeroLockSyncClient(gateway="http://localhost:8080") as client:
    shard = client.get_shard("my-shard")
    client.commit_shard("my-shard", "new-value", shard.version)
```

## Error Handling

```python
from zerolock_sdk import StaleCommitError, ShardNotFoundError

try:
    await client.commit_shard("my-shard", "value", expected_version)
except StaleCommitError as e:
    print(f"Conflict! Shard {e.shard_id} is now version {e.current_version}")
except ShardNotFoundError as e:
    print(f"Shard {e.shard_id} not found")
```

