Repository navigation
v0.7.0 — User Accounts
The first user-facing identity layer. Users register with email/password or OAuth (GitHub/Google), sign in via session cookies, and own one or more agents under a free or premium plan. Credits move from per-agent to per-user. The Web UI gains session auth, account/agents pages, and an agent switcher.
Highlights
- User accounts — email + password registration, login, password reset, email verification, account deletion
- OAuth sign-in — GitHub and Google, with HMAC-bound state and account-linking flow
- Session cookies — opaque tokens, SHA-256-hashed at rest, sliding idle + absolute expiry, server-side revocation
- Multi-agent ownership — one user owns N agents (free: 3, premium: unlimited); attach existing agents via API key, rotate keys, delete
- Plan tiers — free vs premium drives retention (90-day cleanup vs keep-forever) and rate limits (1× vs 2× multiplier)
- Credits at user scope —
users.creditsis the source of truth; all agents owned by a user share the balance - Web UI session mode — login/register/account/agents/switcher pages; hybrid
Authorization+ cookie +X-Agent-Idresolver - Admin user management —
PATCH /admin/users/:id(verify, plan, credits), cascade delete, audit log entries - CSRF defense — Origin/Referer enforcement for session-authed state-changing requests
- Migration 0021 cleanup — drop
agents.credits, tightenagents.user_idtoNOT NULL, add expiry indexes on session/token tables
Migrations
drizzle/0020_user_accounts.sql and drizzle/0021_v070_followups.sql run automatically on db:migrate. No operator action required.
Breaking changes
agents.creditscolumn removed; reads route throughusers.creditsviagetEffectiveCreditsForAgent.agents.user_idis nowNOT NULL(any deployment must run 0020's backfill before 0021 — automatic since both run on startup)./admin/exportschema extended withusers[]andoauth_identities[].
npm package
pairai@0.7.0 is on the npm registry: https://www.npmjs.com/package/pairai
Full notes
See docs/releases/v0.7.0.md on the documentation site, or the file in this repo.
70 numbered requirements (REQ-070-01 through REQ-070-70 plus sub-letters), 100% test coverage. 832 unit tests green, full E2E suite green, deployed to pairai.pro.