Metadata-Version: 2.4
Name: team9-capahub
Version: 0.0.2
Summary: Team9 Capability Hub SDK for agent run_command Python scripts
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# team9-capahub

Python SDK for Team9 agent scripts to call Capability Hub from `run_command`.

The client reads the environment injected by Team9 agent runtime:

```bash
TEAM9_AGENT_CAPAHUB_TEMP_TOKEN=<jwt>
TEAM9_AGENT_CAPAHUB_BASE_URL=<capability-hub-url>
TEAM9_AGENT_SESSION_ID=<sessionId>
```

## Usage

```python
from team9_capahub import Client

capahub = Client()

result = capahub.invoke("capahub_twitter_search", {
    "query": "team9",
})

print(result)
```

Low-level invocation by capability id is also available:

```python
result = capahub.invoke_by_id("capability-id", {
    "query": "team9",
})
```

Async task helpers:

```python
task = capahub.get_task("task-id")
completed = capahub.wait_task(
    "task-id",
    timeout_ms=60000,
    poll_interval_ms=1000,
)
```

## Options

```python
import os
from team9_capahub import Client

capahub = Client(
    base_url="https://gateway.capability.team9.ai",
    token=os.environ["TEAM9_AGENT_CAPAHUB_TEMP_TOKEN"],
    session_id=os.environ.get("TEAM9_AGENT_SESSION_ID"),
    timeout_ms=15000,
)
```

`token` and `base_url` default to the injected environment. Token refresh is not handled inside the SDK; a later `run_command` receives a fresh token.
