Next.js/Vercel rejects having both middleware.ts and proxy.ts. The existing
proxy.ts already protected all app routes and handles the onboarding redirect.
Extended it with /sign-out and /thoughts as public paths.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Next.js 16 renamed middleware.ts to proxy.ts. Having both files caused a
build error. Merged the complete auth logic (public paths, invite bypass,
API pass-through, onboarding redirect) into proxy.ts and deleted the
redundant middleware.ts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Auth & multi-user:
- GitHub OAuth via next-auth DrizzleAdapter; signIn callback absorbs first
login into is_default=true user so all pre-auth data stays accessible
- getCurrentUserId() helper; onboarding + profile pages
- normalizeUsername() extracted to lib/username.ts (DRY fix)
Design system:
- All public pages (landing, sign-in, onboarding, settings) rebuilt to use
ui-* classes and semantic tokens only — zero raw Tailwind color violations
- ui-input, ui-btn-*, ui-panel, bg-surface-*, text-text-* throughout
Reliability (M1–M7):
- M1: Stale claude-stop-active lock cleanup on stop hook entry
- M2: /api/inject validates tab exists in Zellij before writing /tmp
- M3: Prompt SSOT unified — claude-prompts.json single array format
- M4: DBUS UID hardcode removed (already in dotfiles)
- M5: auth.ts signIn callback + AdapterAccountType cast
- M6: project_states DB table — persists ready/closing/closed/session/prompt
across reboots; stop.sh PATCHes on stop/close; control falls back to DB
when /tmp is empty (24h window); inject writes currentPrompt to DB
- M7: scheduleOpenClawWorker now async; waits for spawn event (2s timeout);
marks run as error in DB if worker fails to start
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>