Metadata-Version: 2.4
Name: elizaos-plugin-zalouser
Version: 2.0.0
Summary: Zalo Personal Account plugin for elizaOS - Python implementation via zca-cli
Project-URL: Homepage, https://github.com/elizaos/eliza
Project-URL: Documentation, https://elizaos.ai/docs
Project-URL: Repository, https://github.com/elizaos/eliza
Author: elizaOS Contributors
License-Expression: MIT
Keywords: agents,ai,chat,elizaos,messaging,vietnam,zalo
Classifier: Development Status :: 4 - Beta
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 :: Communications :: Chat
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.28.0
Requires-Dist: pydantic>=2.10.0
Provides-Extra: dev
Requires-Dist: mypy>=1.14.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: python-dotenv>=1.0.0; extra == 'dev'
Requires-Dist: ruff>=0.8.0; extra == 'dev'
Description-Content-Type: text/markdown

# elizaOS Plugin: Zalo User (Python)

Zalo Personal Account integration for elizaOS agents via zca-cli.

## Overview

This plugin enables elizaOS agents to interact with Zalo personal accounts using the zca-cli tool. It supports:

- QR code login flow
- Direct messages (DMs) and group messages
- Multi-profile support
- Friend and group listing
- Media sending (images, links)

## Prerequisites

You must have [zca-cli](https://github.com/nickvt99/zca-cli) installed:

```bash
npm install -g zca-cli
```

Then authenticate with your Zalo account:

```bash
zca auth login
```

## Installation

```bash
pip install elizaos-plugin-zalouser
```

## Configuration

Set the following environment variables:

| Variable | Description | Required |
|----------|-------------|----------|
| `ZALOUSER_ENABLED` | Enable/disable the plugin | No (default: `true`) |
| `ZALOUSER_DEFAULT_PROFILE` | Default zca profile to use | No (default: `default`) |
| `ZALOUSER_COOKIE_PATH` | Path to cookie file for auth persistence | No |
| `ZALOUSER_IMEI` | IMEI for authentication | No |
| `ZALOUSER_USER_AGENT` | User agent for API requests | No |
| `ZALOUSER_PROFILES` | JSON config for multiple profiles | No |
| `ZALOUSER_ALLOWED_THREADS` | JSON array or comma-separated list of allowed thread IDs | No |
| `ZALOUSER_DM_POLICY` | DM policy: `open`, `allowlist`, `pairing`, `disabled` | No (default: `pairing`) |
| `ZALOUSER_GROUP_POLICY` | Group policy: `open`, `allowlist`, `disabled` | No (default: `disabled`) |
| `ZALOUSER_LISTEN_TIMEOUT` | Listen timeout in ms | No (default: `30000`) |

## Usage

```python
from elizaos_plugin_zalouser import ZaloUserService, ZaloUserConfig, SendMessageParams

# Create config
config = ZaloUserConfig.from_env()

# Create and start service
service = ZaloUserService(config)
await service.start()

# Send a message
result = await service.send_message(
    SendMessageParams(
        threadId="123456789",
        text="Hello from elizaOS!",
    )
)

# List friends
friends = await service.list_friends()

# List groups
groups = await service.list_groups()

# Stop service
await service.stop()
```

## License

MIT
