Files
viktor-autoreg/README.md
T

54 lines
3.9 KiB
Markdown

# viktor-autoreg
Reverse-engineered Viktor.com (app.viktor.com) API + autoreg tooling.
![dashboard](docs/dashboard.png)
## What's inside
- `docs/CREDITS.md` — **how to get credits** (16K starter unlock via VCC, Gmail-door bonus, referral/partner/promo mechanics, probe scripts).
- `docs/IDE-GUIDE.md` — **use it in Cursor/Cline/Continue/Claude Code/MCP**: full wiring guide + credits blocker note.
- `SETUP.md` — **start here**: what to enable / change / add (mail pool, IMAP, captcha model, env vars, batch mode, pitfalls).
- `viktor_api.md` — full API surface: 36 endpoints, auth architecture, token exchange flow, anti-bot stack (Verisoul/PostHog), all 4 signup doors mapped with server-side proofs.
- `VERIFICATION.md` — live probe report (2026-10-08): 11/11 endpoint checks with verdicts.
- `viktor_endpoints.json` — normalized endpoint map extracted from 380 SPA chunks.
- `tools/extract_endpoints.py` — static endpoint extractor for minified JS bundles.
- `tools/gws_oauth.py` — Google Workspace SA user creation + headed patchright OAuth runner (Google door; currently server-disabled for signup).
- `dashboard.html` — visual ops dashboard: pipeline stages, file map, env config points, pitfalls, door status (screenshot: `docs/dashboard.png`).
- `tools/slack_reger.py` — **main tool**: full Slack workspace creation flow (reCAPTCHA Enterprise v2 solved in-process via mistral classifier -> work-mail-провайдер IMAP code -> workspace naming -> Viktor Slack OAuth -> jwt_token exchange).
- `tools/viktor_gateway.py` — **OpenAI-compatible gateway** over the Viktor web-chat JWT pool (REST `POST /threads` + WS `tok_delta` streaming reverse-engineered from the SPA; `/v1/chat/completions`, `/v1/models`, `/health`; protocol doc: `docs/GATEWAY.md`).
- `tools/finish_viktor_oauth.py` — finish Viktor OAuth from saved Slack cookies (intercepts jwt_token in-browser; dodges 429).
- `tools/slack_ws.py` — earlier sidecar-HTTP variant (kept for reference; sidecar queue starves under concurrent jobs).
- `tools/email_code_probe.py` — email-code door probe (login-only proof).
## Signup door matrix (2026-10)
| Door | Endpoint | Status |
|------|----------|--------|
| email-code | POST /api/auth/email-code/request | LOGIN-ONLY (server mails "No Viktor account") |
| Google | /oauth/google/login | Server-disabled (`error=signup-unavailable`) |
| MS Teams | /oauth/microsoft/login | Requires work/school tenant |
| Slack | /api/coworker/slack/signin | **FULL CHAIN VERIFIED 2026-10-09** — workspace created, OAuth done, JWT 200, `/api/me` 200 (see VERIFICATION.md). Free local vision solver, $0 |
## Token flow
OAuth callback -> `{exchange_token}` -> `GET /api/auth/jwt_token?exchange_token=` -> `{jwts}` -> `GET /api/coworker/post-signin-state?jwt=` -> cookie `session` (JWT).
## Pipeline (reger -> gateway)
1. `python tools/slack_reger.py --batch N` — creates Slack workspaces, harvests Viktor `exchange_token`/JWT into `accounts.jsonl`
2. `python tools/viktor_gateway.py` — serves `:8700/v1/chat/completions` from that pool (hot reload; round-robin; auto-disable on 401)
## Credits status (2026-10-10)
Fresh workspaces = 0 credits (`402 out of credits`; auth OK). Unlock path: **16 000 starter credits** via card verification (`tools/starter_unlock.py` → pay.viktor.com checkout, $0 auth — VCC works in theory). Probe the whole pool: `tools/credits_probe.py`. Full breakdown of every credit source (starter / Gmail door / connect-bonus / referral / partner `claude_startups` / promo codes): **`docs/CREDITS.md`**.
## Notes
- Chrome cookies `v20` (App-Bound Encryption) can't be moved across profiles; only `v10` decrypts via DPAPI+AES-GCM.
- Workspace ToS speedbump button is "Понятно"/"I understand" (localized).
- patchright headed passes Google identifier checks; headless does not.
- No secrets in this repo. Gmail pool, SA keys and solver configs are external.
Research/interop tooling for authorized testing.