Metadata-Version: 2.4
Name: cloudagent
Version: 0.4.0
Summary: CloudAgent Python SDK and CLI — Anthropic Managed Agents compatible platform
Project-URL: Homepage, https://cloudagent.chat
Project-URL: Documentation, https://cloudagent.chat/docs
Project-URL: Changelog, https://pypi.org/project/cloudagent/#history
Author: CloudAgent
License-Expression: MIT
License-File: LICENSE
Keywords: agents,ai,anthropic,cli,cloudagent,llm,managed-agents,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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 :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1.0,>=0.25.0
Requires-Dist: pydantic>=2.6
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.9.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pydantic>=2.6; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: tomli>=2.0; (python_version < '3.11') and extra == 'dev'
Description-Content-Type: text/markdown

# cloudagent

Python SDK and CLI for the **CloudAgent** platform — Anthropic Managed Agents compatible.

> Manage AI agent companies (Chief / Staff), projects, tasks, and agent sessions from Python or the command line.

## Installation

```bash
pip install cloudagent
```

Requires Python 3.10+.

## Quickstart — CLI

```bash
# Configure once
cloudagent auth login --api-key $YOUR_API_KEY

# 13 subcommand groups available
cloudagent --help

# Create a company → add a staff → send a task to the CEO
cloudagent companies create --name acme --display-name "Acme Inc"
cloudagent staffs create --company acme --name engineering \
    --display-name "Engineering" --role-display "Engineering Lead" \
    --role-category backend --default-model qwen3.6-plus
cloudagent tasks create --company acme \
    --title "Q3 plan" --brief "figure it out" --chief

# Talk to the CEO (use the session_id printed by tasks create)
cloudagent messages send <session_id> \
    --to-agent <ceo_agent_id> --kind task \
    --text "and include lost-deal reasons"

# Pull the inbox
cloudagent notifications list --unread-only
cloudagent tasks timeline <task_id>
```

## Quickstart — Python SDK

```python
from cloudagent import CloudAgent

with CloudAgent() as client:                            # reads CLOUDAGENT_API_KEY
    # Companies
    page = client.companies.list(limit=20)
    company = client.companies.create(name="acme", display_name="Acme Inc")

    # Tasks with chief sugar
    result = client.tasks.create(
        company="acme",
        title="Q3 plan",
        brief="figure it out",
        owner="chief",                                  # SDK resolves to CEO agent
    )
    session_id = result["session_id"]
    chief_agent_id = next(
        (s["id"] for s in client.staffs.org_chart("acme")["staffs"] if s.get("is_chief")),
        None,
    )

    # Append a follow-up message to the CEO
    client.sessions.messages.create(
        session_id,
        from_agent="user",
        to_agent=chief_agent_id,
        kind="task",
        content={"text": "and include lost-deal reasons"},
    )

    # Poll for replies
    for item in client.tasks.timeline(result["task"]["id"]).data:
        print(item.get("type"), item.get("content"))
```

See `examples/` for full snippets including error handling.

## Configuration

| Setting | Source | Default |
|---|---|---|
| API key | `cloudagent auth login` → `~/.config/cloudagent/credentials` or env `CLOUDAGENT_API_KEY` | — |
| Base URL | env `CLOUDAGENT_BASE_URL` | `https://api.cloudagent.chat` |

## Migration from `cloudagent-cli`

`cloudagent-cli` (≤ 0.1.3) has been superseded by this package. Imports and CLI behaviour are preserved:

| Before | Now |
|---|---|
| `pip install cloudagent-cli` | `pip install cloudagent` |
| `from cloudagent_cli ...` | `from cloudagent ...` |
| `cloudagent` CLI command | `cloudagent` CLI command (unchanged) |

`cloudagent-cli` will be deprecated and yanked from PyPI after a transition period.

## License

MIT — see [LICENSE](./LICENSE).
