Files
haze-toolkit/README.md
T

45 lines
2.1 KiB
Markdown

# Haze Toolkit
Research toolkit for usehaze.ai (Haze AI workspace, Tauri desktop app).
## What's here
| File | Purpose |
|------|---------|
| `haze_proxy.py` | OpenAI-compatible proxy over `https://v1.usehaze.ai/ai/v1` with token pool, round-robin rotation, auto-quarantine of dead tokens, upstream-error retry, SSE streaming |
| `mass_reg.py` | Mass registration: `POST /api/auth/bootstrap` (create:true) → IMAP OTP from t-online.de → `POST /api/auth/verify-code` → token into pool. Pacing + 429 backoff. State-resumable |
| `reg_one.py` | Single-account registration flow |
| `cdp_eval.py` | CDP eval helper against WebView2 (`--remote-debugging-port=9333`) |
| `fill_dialog.py` | Native Win32 folder-picker automation (SendMessageW WM_SETTEXT + BM_CLICK) for Tauri dialogs |
| `brotli_extract.py` | Extract embedded brotli frontend assets from `Haze.exe` |
## Architecture findings
- Desktop app = Tauri + WebView2; page URL `http://tauri.localhost/`
- Real model gateway: `https://v1.usehaze.ai/ai/v1` (OpenAI-compatible chat/completions + models catalog), auth = Bearer WorkOS access token (~24h exp)
- `gateway.legionedge.ai` = local-agent relay (kimi harness), not the chat gateway
- Model catalog is server-side (not in binary): `gpt-6-astra`, `gpt-6-luna`, `gpt-6-sol`, `gpt-6.1-sol`, `step-5-preview`
- Auth flow: WorkOS OTP email from `welcome@workos.dev`; `bootstrap create:false` = login (401 if unknown), `create:true` = register (`verification_required` + `pendingToken`)
- Cloudflare blocks bare python-urllib (403); curl with browser UA passes
- Free plan accounts get full model catalog access
## Proxy usage
```bash
python haze_proxy.py 16450
# GET /v1/models GET /health GET /pool
# POST /v1/chat/completions (stream: true supported)
```
Point any OpenAI client at `http://127.0.0.1:16450/v1`, api_key = any string.
Pool file: `tokens.json` — `[{"token":"***","email":"...","ok":true,"fails":0}]`
## Mass reg usage
```bash
python mass_reg.py <count> <workers> # reads email:pass pool file, writes tokens.json + accounts.jsonl
```
Resumable: `reg_state.json` tracks used mailboxes; 429 failures are retryable after backoff.