Metadata-Version: 2.4
Name: beeos-bridge-client
Version: 0.1.0
Summary: BeeOS Bridge Client SDK — Ed25519 authenticated async WebSocket client for connecting agents to the Bridge server
Author-email: BeeOS <dev@beeos.ai>
License-Expression: MIT
Keywords: agent,beeos,bridge,ed25519,sdk,websocket
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
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
Requires-Python: >=3.11
Requires-Dist: cryptography>=43.0
Requires-Dist: websockets>=13.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# beeos-bridge-client

Python SDK for connecting agents to the BeeOS Bridge server via Ed25519 authenticated WebSocket.

Mirrors the Node.js SDK (`@beeos-ai/bridge-client`) — same protocol, same key file format, fully interoperable.

## Install

```bash
pip install beeos-bridge-client
```

## Quick Start

```python
import asyncio
from beeos_bridge_client import BridgeClient, BridgeClientOptions

async def main():
    client = BridgeClient(BridgeClientOptions(
        bridge_url="wss://bridge.beeos.ai",
        service="acp",
        key_file="~/.beeos/device-agent.key",
    ))

    client.on("connected", lambda: print("Connected!"))
    client.on("message", lambda data: print("Received:", data))

    await client.connect()
    await client.send('{"jsonrpc":"2.0","method":"ping","id":1}')

asyncio.run(main())
```

## Key Management

```python
from beeos_bridge_client import generate_key_pair, load_key_pair, fingerprint

# Generate and save
kp = generate_key_pair(save_to="~/.beeos/key.json")

# Load (auto-generates if missing)
kp = load_key_pair("~/.beeos/key.json")

# Fingerprint (SHA-256 hex, matches Go Bridge)
print(fingerprint(kp.public_key))
```

Supports two key file formats (same as Node.js SDK):
1. JSON: `{"publicKey": "<base64>", "privateKey": "<base64>"}`
2. Raw base64 seed (32 bytes) — for K8s Secret mounts
