Commit Graph
368 Commits
Author SHA1 Message Date
kaitranntt 49b4065186 feat(usage): add internal data aggregation and cost tracking 2025-12-09 23:41:47 -05:00
kaitranntt 1e11d2e40a feat(analytics): aggregate usage from all CCS auth profiles
Add multi-instance support to usage analytics. The dashboard now
aggregates usage data from ~/.claude/ AND all CCS instances in
~/.ccs/instances/<profile>/.

- Add getInstancePaths() to discover CCS instances with usage data
- Add loadInstanceData() to load data from specific instance
- Add merge functions for daily/monthly/session data with deduplication
- Modify refreshFromSource() to aggregate from all instances sequentially
- Merge by date/sessionId to avoid double-counting overlapping usage
2025-12-09 15:15:55 -05:00
kaitranntt 96d9fc68e9 feat(dashboard): add Environment and OAuth Readiness groups to health page
Bring OAuth diagnostics from ccs doctor to web dashboard:

- Add Environment group showing platform, SSH, TTY, browser capability
- Add OAuth Readiness group showing port availability (8085, 1455, 51121)
- Reuse existing environment-diagnostics and oauth-port-diagnostics modules

The dashboard health page now has 7 groups matching ccs doctor output.
2025-12-09 13:00:04 -05:00
kaitranntt abb156d9f4 perf(analytics): instant dashboard loading with disk cache persistence
- Add React lazy loading for heavy pages (Analytics, Settings, etc.)
- Remove blocking prewarmUsageCache() from server startup
- Add disk cache module for persistent usage data storage
- Fix disk cache not being created on first Analytics visit
- Write cache immediately when daily data available (don't wait for all 3 types)

Dashboard now loads in <10ms from disk cache instead of waiting for
better-ccusage library on every visit.
2025-12-09 01:07:42 -05:00
kaitranntt 69e6a32224 perf(analytics): add cache pre-warming and SWR pattern for instant page load
- Add server-side cache pre-warming on startup (non-blocking)
- Implement stale-while-revalidate pattern (1hr stale window)
- Add /api/usage/status endpoint for cache status
- Remove full-page blocking skeleton, use per-component loading
- Add "Updated X ago" timestamp indicator in UI header
- Export AnalyticsSkeleton component for potential future use
2025-12-08 23:09:01 -05:00
kaitranntt a721af3cf3 feat(analytics): add usage analytics page with caching layer
- Add Analytics page with usage trends, model breakdown, sessions table
- Add server-side caching layer for better-ccusage data (TTL-based)
- Add request coalescing to prevent duplicate concurrent API calls
- Add /api/usage/refresh endpoint to manually clear cache
- Add date-range filter, summary cards, trend charts components
- Fix API parameter mismatch (since/until in YYYYMMDD format)
- Wire up Refresh button with loading state animation
2025-12-08 21:47:36 -05:00
kaitranntt efb42ba8f6 fix(security): improve API key detection patterns to prevent false positives
- Change from substring to pattern-based matching for sensitive keys
- Prevents ANTHROPIC_MAX_TOKENS from being incorrectly censored
- Synchronize backend and UI detection logic for consistency
2025-12-08 16:32:52 -05:00
kaitranntt 13194fecbe fix(web): correct skill detection to look for SKILL.md instead of prompt.md
The Skills page was only showing 4 skills instead of 38 because it was
looking for prompt.md files instead of SKILL.md files in the skills
directory. Updated the detection logic to check for SKILL.md for skills
and prompt.md for agents.
2025-12-08 16:14:30 -05:00
kaitranntt 8aae0db7da feat(ui): redesign health dashboard to match ccs doctor output
- Rewrite health-service.ts with 20+ comprehensive checks in 5 groups
  (System, Configuration, Profiles & Delegation, System Health, CLIProxy)
- Add async support for port checking functionality
- Create new health-check-item.tsx component with collapsible design
- Redesign health.tsx with professional grouped layout, hero section,
  summary stats, and issues panel with actionable fix commands
- Update use-health.ts with HealthGroup type support
- Add development server documentation to CLAUDE.md
2025-12-08 15:00:07 -05:00
kaitranntt cc1655624c feat(ui): Enhance web overview with new components and data 2025-12-08 14:11:44 -05:00
kaitranntt 4dc17fac4f feat(cliproxy): add multi-account support for CLIProxy providers
- Implement account-manager.ts for managing multiple OAuth accounts per provider
- Add account selector in UI dialog with dropdown for authenticated accounts
- Extend auth-handler.ts to support account registration and multi-account authentication
- Update web-server routes with account management endpoints (GET/POST/DELETE)
- Add account badges and management UI in cliproxy page
- Support account field in CLIProxy variant configuration
- Add Badge component from shadcn/ui for UI styling
- Enable default account selection and account removal functionality
2025-12-08 00:16:49 -05:00
kaitranntt a283f942a9 feat(cliproxy): add authentication status display to web dashboard
- Add auth status endpoint to show built-in profiles authentication state
- Display auth status in UI with visual indicators for authenticated state
- Show last authentication date and token file count
- Update CLI command to better differentiate between built-in profiles and custom variants
- Improve UI layout to separate built-in profiles from custom variants
2025-12-07 20:32:00 -05:00
kaitranntt e078f15297 feat(web): update shared routes and home page for dashboard 2025-12-07 20:00:01 -05:00
kaitranntt 6e2da6458a feat(web): enhance dashboard functionality and ui components 2025-12-07 19:56:26 -05:00
kaitranntt 23a33820c0 feat(web-dashboard): add dev mode with hmr and optimize build 2025-12-07 16:44:34 -05:00
kaitranntt 59758024c9 feat(web-dashboard): complete settings, health, shared data and build integration
- Settings editor with API key masking and conflict detection
- Health dashboard with status cards and one-click fixes
- Home dashboard with stats and quick actions
- Shared data viewer for commands/skills/agents
- Build scripts for UI + server bundle
- Bundle size verification (<500KB gzipped)
- Pre-release checklist script
2025-12-07 14:23:56 -05:00
kaitranntt 56502ab6a8 feat(web-dashboard): add rest api and real-time sync
REST API & CRUD:
- Add REST API routes for profiles, cliproxy, accounts
- Integrate React Query with data fetching hooks
- Create API client wrapper with TypeScript types
- Add shadcn/ui components (dialog, input, label, table)
- Build profiles table with edit/delete actions
- Create profile form dialog with zod validation
- Mount QueryClientProvider in App

Real-time Sync & WebSocket:
- Implement file watcher with chokidar for config changes
- Create WebSocket server with broadcast capability
- Add client auto-reconnect with exponential backoff
- Integrate React Query cache invalidation on WS messages
- Add connection status indicator in header
- Implement heartbeat keepalive (30s interval)
- Add graceful cleanup on server shutdown
- Show toast notifications for external config changes

Dependencies:
- Add @tanstack/react-query, react-table, react-hook-form, zod
- Add chokidar for file watching
2025-12-07 12:00:56 -05:00
kaitranntt 6a6f2a2463 feat(web-dashboard): add express server and react ui scaffolding 2025-12-07 11:37:28 -05:00