Metadata-Version: 2.4
Name: leviathantalon-chat-cli
Version: 3.5.0
Summary: L41: Terminal chat REPL + HTTP API server. Run the entire swarm from a terminal like Claude Code, or from your app via REST.
Author: HaChazal (Chaz Leland Hamm)
License: Proprietary - Metanoia Unlimited LLC
Requires-Python: >=3.9
Requires-Dist: aiohttp>=3.9
Requires-Dist: leviathantalon-c2>=3.4.0
Requires-Dist: leviathantalon-llm-providers>=3.2.3
Requires-Dist: leviathantalon-subs>=3.1
Requires-Dist: leviathantalon-swarm>=1.0
Description-Content-Type: text/markdown

# L41 — Terminal Chat + HTTP API Server

Run the entire LeviathanTalon swarm from a terminal or from your app.

## Terminal REPL (like Claude Code)

```bash
leviathantalon chat          # or: lvtn chat
leviathantalon chat --profile large --provider ollama
```

```
🐉 LeviathanTalon v3.5 | 41 layers | 1,286 integrations | profile: medium

> /status
  HaChazal (Da'at)    ONLINE   caps=7    subs=7/7
  Uriel (Netzach)     ONLINE   caps=4    sniper: paper-mode
  Katan (Malkuth)     ONLINE   caps=12   L40: DISARMED (paper)

> @uriel sniper.safety_gauntlet mint=DOGGO
  [C2] command c8a3f → uriel → dispatched → completed (4.2ms)
  output: {ok: true, stage: safety_gauntlet, would_run: true}

> /transfer file:///home/chaz/report.pdf sftp://chaz@win/C:/Desktop/report.pdf --password $PW
  [Bridge] ✓ file_to_sftp (8,201 bytes, SHA-256 verified)

> /arm
  [Safety] ✓ ARMED (token: a3f8..., watchdog: 100ms)

> /providers
  ✓ ollama          llama3.2        local (ready)
  ✗ anthropic       claude-sonnet   ANTHROPIC_API_KEY not set
  ✗ openai          gpt-4o-mini     OPENAI_API_KEY not set

> Tell me about this token's safety profile   (natural language → LLM routes it)
  [LLM → HaChazal] intent: analyze_token_safety, target: uriel
  [C2] command d9b2a → uriel → completed
  ...

> /quit
```

## Three input modes

| Mode | Syntax | LLM needed? |
|---|---|---|
| **Slash commands** | `/status`, `/arm`, `/transfer src dst`, `/providers`, `/history`, `/quit` | No |
| **Direct dispatch** | `@sub_name capability_name key=value key2=value2` | No |
| **Natural language** | Any other text → sent to LLM head for intent extraction → C2 dispatch | Yes (falls back to "no LLM wired" error) |

## HTTP API Server

```bash
leviathantalon serve --port 8708    # or: lvtn serve
```

Endpoints:
- `POST /api/chat` — `{"message": "..."}` → same routing as terminal REPL
- `POST /api/command` — `{"target_sub": "uriel", "capability": "...", "args": {...}}` → direct C2 dispatch
- `GET /api/status` — full swarm status (subs, registry, mesh, balancer, ethics, safety)
- `GET /api/providers` — list all LLM providers with availability
- `GET /api/integrations` — list all registered integrations
- `POST /api/arm` — ARM the safety interlocks
- `POST /api/disarm` — DISARM
- `GET /api/health` — liveness probe

All responses are JSON. CORS enabled for local dev.

## Run locally on a VPS

```bash
# 1. Clone or unzip the swarm
unzip leviathantalon-PRODUCTION-ELITE-v3.5.zip
cd leviathantalon-swarm

# 2. Install everything
pip install -e .lpls/baseline -e .lpls/patches/0001* ... -e .lpls/patches/0041*
# Or use the install-all script (coming in v3.6)

# 3. Set your LLM provider (any ONE is enough)
export ANTHROPIC_API_KEY=sk-...     # or:
# ollama pull llama3.2              # free local LLM

# 4. Set VPS profile
export LEVIATHAN_PROFILE=medium     # or small / large

# 5. Start the chat
leviathantalon chat

# 6. Or start the API server for your app
leviathantalon serve --port 8708
```
