nyk commited on
Commit
bfb8731
·
unverified ·
1 Parent(s): 2263da2

feat: add local mode auto-detection for no-gateway users (#83)

Browse files

When no OpenClaw gateway is detected, Mission Control now automatically
switches to Local Mode — showing a clear info banner, greying out
gateway-dependent panels, and surfacing Claude Code session stats,
GitHub profile data, and subscription-aware cost display.

Changes:
- Add capabilities endpoint to detect gateway, Claude home, subscription
- Add dashboardMode/gatewayAvailable/subscription state to Zustand store
- Add dismissible LocalModeBanner component
- Grey out Agents/Spawn/Config nav items when no gateway
- Show blue "Local Mode" indicator instead of red "Disconnected"
- Dashboard shows local metric cards (sessions, projects, tokens, cost)
- Claude Code Stats panel with session/token/cost breakdown
- GitHub panel with repo stats, languages, star/fork counts
- Subscription detection from ~/.claude/.credentials.json
- Show "Included (Max plan)" instead of dollar cost for subscribers
- Fix token cost estimation (cache reads at 10%, not 100%)
- Sessions API falls back to local Claude session scanner
- Live feed injects session items in local mode
- Memory browser auto-creates data dir with fallback path

14 files changed +785 -203
Files changed (14)
src/app/api/github/route.ts+87-1
src/app/api/memory/route.ts+6
src/app/api/sessions/route.ts+68-20
src/app/api/status/route.ts+47-1
src/app/page.tsx+57-18
src/components/dashboard/dashboard.tsx+362-122
src/components/layout/header-bar.tsx+20-3
src/components/layout/live-feed.tsx+22-4
src/components/layout/local-mode-banner.tsxAdded+34
src/components/layout/nav-rail.tsx+35-21
src/components/panels/memory-browser-panel.tsx+11-7
src/lib/claude-sessions.ts+14-5
src/lib/config.ts+2-1
src/store/index.ts+20