Commit Graph
682 Commits
Author SHA1 Message Date
kaitranntt b911db8b5f refactor(ui): add barrel exports for analytics and components root
- add analytics/index.ts aggregating chart components

- add components/index.ts as main entry point
2025-12-19 19:44:04 -05:00
kaitranntt 3c7b0e7a65 refactor(ui): organize shared components into shared/ directory
- move ccs-logo, code-editor, command-builder, confirm-dialog

- move connection-indicator, docs-link, github-link, etc.

- add barrel export in shared/index.ts
2025-12-19 19:43:28 -05:00
kaitranntt bef9955123 refactor(ui): organize layout components into layout/ directory
- move app-sidebar, hero-section, hub-footer, layout

- move theme-provider, theme-toggle

- add barrel export in layout/index.ts
2025-12-19 19:42:54 -05:00
kaitranntt a106aa2ee6 refactor(ui): organize health components into health/ directory
- move health-card, health-gauge, health-check-item

- move health-group-section, health-stats-bar

- add barrel export in health/index.ts
2025-12-19 19:42:24 -05:00
kaitranntt 81196b0ff1 refactor(ui): split quick-setup-wizard into setup/wizard/ directory
- extract 541-line component into step modules

- wrap accounts in useMemo for stable deps

- add barrel export in setup/index.ts
2025-12-19 19:41:51 -05:00
kaitranntt 6778c4d637 refactor(ui): split profile-editor into profiles/editor/ directory
- extract 531-line component into 10 focused modules

- move profile dialogs, card, deck, table to profiles/

- fix react-hook-form watch() using useWatch for compiler compat

- add barrel export in profiles/index.ts
2025-12-19 19:41:17 -05:00
kaitranntt 946030c836 refactor(ui): split error-logs-monitor into monitoring/error-logs/ directory
- extract 617-line component into 6 focused modules

- move auth-monitor, proxy-status-widget to monitoring/

- add barrel export in monitoring/index.ts
2025-12-19 19:40:43 -05:00
kaitranntt 1b1015cf50 refactor(ui): split copilot-config-form into copilot/config-form/ directory
- extract 846-line component into 13 focused modules

- add barrel export in copilot/index.ts
2025-12-19 19:40:06 -05:00
kaitranntt 4bea5a3346 refactor(ui): split provider-editor into cliproxy/provider-editor/ directory
- extract 921-line component into 13 focused modules

- move cliproxy-dialog, cliproxy-table, cliproxy-stats-overview

- add barrel export in cliproxy/index.ts
2025-12-19 19:39:32 -05:00
kaitranntt 8fd35c8dd6 refactor(ui): split account-flow-viz into account/flow-viz/ directory
- extract 1,144-line monster file into 12 focused modules

- add hooks.ts, types.ts, utils.ts for reusable logic

- create backward-compatible re-export shim

- add barrel export in account/index.ts
2025-12-19 19:38:58 -05:00
kaitranntt 4036c42687 feat(cliproxy): auto-apply default preset when adding first account
- Add presetMapping to Gemini, Antigravity, Codex models
- Auto-apply preset when adding first account (Add/QuickSetup)
- Extract applyDefaultPreset to preset-utils.ts (DRY)
- Add warning toast on preset failure
- Extract port 8317 to CLIPROXY_PORT constant
2025-12-19 11:26:17 -05:00
kaitranntt 598454c931 fix(cliproxy): include BASE_URL and AUTH_TOKEN when applying presets
Presets now always include ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN
when applied to provider settings. This ensures CLIProxy routing works
correctly for Gemini, Codex, and Agy providers.

Also fixes settings save failing for new profiles by changing PUT
/api/settings/:profile to upsert behavior (create if not exists).
2025-12-19 09:44:14 -05:00
kaitranntt 03aea4eac2 fix(remote-proxy): fix TypeError and make port optional with protocol defaults
- Fix TypeError: error.code?.toLowerCase - add type guard for non-string error codes
- Make remote proxy port optional - defaults to 443 (HTTPS) or 80 (HTTP)
- Smart URL building - omits port when using protocol default
- UI improvements - show default port hint, allow empty port field
- Better validation - only host is required, port uses smart defaults

Closes #142
2025-12-19 04:23:20 -05:00
kaitranntt 8d8d4c248a refactor: rename proxy to cliproxy_server and update API routes 2025-12-19 02:14:49 -05:00
kaitranntt eeb6913d96 style(ui): use sidebar accent colors for proxy update button
- replace hardcoded amber-600 with sidebar-accent theme variable

- improve consistency with sidebar theme
2025-12-19 01:41:04 -05:00
kaitranntt 9a9ef98542 feat(ui): add Proxy settings tab to dashboard
- add Proxy tab with Local/Remote mode toggle cards

- add remote server config inputs (host, port, protocol, auth token)

- add Test Connection button with reachability status display

- add fallback settings (enable fallback, auto-start local)

- add local proxy port configuration

- add getProxyConfig, updateProxyConfig, testProxyConnection API methods
2025-12-19 01:17:20 -05:00
kaitranntt d43079b724 feat(ui): add version sync timestamp to ProxyStatusWidget
- Show current CLIProxyAPI version (e.g., v6.5.53)
- Display "Synced Xm ago" with full timestamp on hover
- Extend API response to include checkedAt timestamp
2025-12-18 23:24:15 -05:00
kaitranntt 96762a9f6e feat(ui): show CLIProxyAPI update availability in dashboard
- Add GET /api/cliproxy/update-check endpoint
- Export checkCliproxyUpdate() function from binary-manager
- Add useCliproxyUpdateCheck hook with 1-hour cache
- Update ProxyStatusWidget with amber "Update" badge when available
- Highlight Restart button as "Update" with amber styling when update pending
2025-12-18 23:17:05 -05:00
kaitranntt c9ad0b0779 feat(ui): add Stop and Restart buttons to ProxyStatusWidget
- Add POST /api/cliproxy/proxy-stop API endpoint
- Add proxyStop method in api-client and useStopProxy hook
- Update ProxyStatusWidget with Stop and Restart controls when running
- Restart = stop + delay + start (for applying CLIProxyAPI updates)

Complements the fix in binary-manager.ts which now tells users to stop
proxy before updates can be applied.
2025-12-18 23:03:45 -05:00
kaitranntt 248d970cba style(ui): widen cliproxy sidebar from w-64 to w-80 2025-12-18 22:44:07 -05:00
kaitranntt 5d343260c7 feat(global-env): add global environment variables injection for third-party profiles
- add global_env config section to unified config types and loader

- inject global env vars at runtime for cliproxy and copilot profiles

- add GET/PUT /api/global-env endpoints for UI management

- add Global Env tab to Settings page with enable toggle and var management

- add GlobalEnvIndicator component showing injected vars in profile editors

- support ?tab=globalenv query param for direct navigation from indicators
2025-12-18 22:38:25 -05:00
kaitranntt 5d4f49e4bb feat(ui): add absolute path copy for error logs
- add absolutePath field to CliproxyErrorLog interface
- inject absolute path in routes.ts from getCliproxyWritablePath()
- update copy button to use absolute path with fallback to filename
- refactor error-logs-monitor to remove demo mode
- add error-log-parser lib for structured log parsing
2025-12-18 21:06:20 -05:00
Kai (Tam Nhu) TranandGitHub 03e9bdc917 Merge pull request #133 from kaitranntt/kai/feat/error-log-viewer
feat(dashboard): add error log viewer for CLIProxy diagnostics
2025-12-18 18:31:16 -05:00
kaitranntt 8f47b8775f feat(ui): redesign error logs monitor with split view layout
- Replace dropdown accordion with master-detail split view
- Add log list panel (240px) on left with selection state
- Add content viewer panel on right for better readability
- Add demo mode prop for UI testing
- Auto-select first log via useMemo/derived state
2025-12-18 18:23:38 -05:00
Kai (Tam Nhu) TranandGitHub efdf53c83c Merge pull request #138 from kaitranntt/kai/feat/copilot-integration
feat(copilot): add GitHub Copilot integration with CLI, API, and dashboard
2025-12-18 05:41:38 -05:00
kaitranntt da5dc31ec4 fix(ui): constrain copilot config left panel width to 540px 2025-12-18 05:31:37 -05:00
kaitranntt f9b89dee12 fix(ui): improve copilot sidebar logical order and remove redundancy
Changes:
- Reordered sidebar to follow logical flow:
  1. Setup: copilot-api binary → Integration enabled
  2. Auth: GitHub connection (only after binary installed)
  3. Daemon: status/port (only after authenticated)
- Removed redundant Config section (Model/Account already in right panel)
- Progressive disclosure: sections appear as prerequisites are met
2025-12-18 05:26:58 -05:00
kaitranntt 60c01c7e60 fix(ui): handle 404 errors in profile settings fetch
- throw on non-OK responses in ProfileEditor queryFn
- add isError state with user-friendly message and retry button
- add defensive null check for data.path before .replace() call
- apply same defensive check to provider-editor.tsx

Fixes blank screen when API profile settings file doesn't exist.
2025-12-18 05:25:52 -05:00
kaitranntt ec6face8db fix(copilot): use gpt-4.1 as default model and 127.0.0.1 for local connections
Key changes:
- Changed default model from claude-sonnet-4.5 to gpt-4.1 (free tier compatible)
- Updated all Claude models to minPlan: 'pro' (requires paid Copilot subscription)
- Replaced 'localhost' with '127.0.0.1' for more reliable local connections
  (bypasses DNS resolution and potential IPv6 issues)
- Updated UI presets: replaced Claude Haiku with Raptor Mini in free tier
- Fixed FREE_PRESETS to only include actually free models

This fixes the "model_not_supported" error when using free tier GitHub Copilot
subscription, which doesn't have access to Claude models.
2025-12-18 04:58:49 -05:00
kaitranntt a9788d02ea docs(copilot): add prominent disclaimer for unofficial API
Make the "use at your own risk" warning more transparent:
- UI: Expanded warning banner with clear "Unofficial API" heading
- UI: Added explicit no warranty/no responsibility text
- Config YAML: Updated comments with !! DISCLAIMER !! section
- Types: Updated CopilotConfig JSDoc with full disclaimer

CCS provides no warranty and accepts no responsibility for
consequences of using this reverse-engineered GitHub Copilot API.
2025-12-18 04:20:58 -05:00
kaitranntt 87c2acc416 feat(ui): display plan tiers and presets in copilot model selector
- Add CopilotPlanTier type and extend CopilotModel with minPlan,
  multiplier, preview fields
- Show plan tier badges (free/pro/pro+/business/enterprise) with
  color-coded styling in model dropdown
- Display multiplier info (0x=free, 1x=standard, 3x-10x=premium)
- Add Preview badge for non-GA models
- Create 3 free tier presets: GPT-4.1, GPT-5 Mini, Claude Haiku 4.5
- Create 5 paid presets: Claude Opus/Sonnet 4.5, GPT-5.2,
  GPT-5.1 Codex Max, Gemini 2.5 Pro
- Separate presets into Free Tier and Pro+ Required sections
2025-12-18 04:15:08 -05:00
kaitranntt a66abba174 feat(cliproxy): implement interactive project selection for OAuth flows
- Add ProjectSelectionHandler to parse and handle CLIProxy project prompts
- Integrate project selection into AuthHandler with UI-first support
- Add project selection API endpoints and WebSocket events
- Implement ProjectSelectionDialog and useProjectSelection hook in UI
- Fixes macOS OAuth timeout by handling interactive project selection via UI
2025-12-18 04:11:59 -05:00
kaitranntt 5f0fde9a61 feat(ui): expose auth result with device code in hook
- add CopilotAuthResult interface with deviceCode field

- expose startAuthAsync and authResult from useCopilot hook

- immediately refetch status on auth success
2025-12-18 03:01:12 -05:00
kaitranntt 1ef625ee86 fix(error-logs-monitor): properly handle status loading state
- Add isStatusLoading check to prevent false-negative rendering
- Use nullish coalescing for enabled param to ensure boolean value
- Component now waits for status before deciding visibility

Fixes initial render returning null due to undefined status
2025-12-18 02:45:58 -05:00
kaitranntt 3865747154 fix(ui): add install button to copilot page sidebar
- show Install copilot-api button when not installed

- display version in status when installed
2025-12-18 02:38:58 -05:00
kaitranntt ddf7b704a5 Merge remote-tracking branch 'origin/dev' into kai/feat/error-log-viewer 2025-12-18 02:33:06 -05:00
kaitranntt 170dcdc44f fix(ui): limit Connection Timeline to 100 events to prevent lag
- add MAX_TIMELINE_EVENTS constant (100)

- slice events in useMemo to cap DOM elements

- prevents UI freeze with high request counts
2025-12-18 02:30:47 -05:00
kaitranntt f813ad06f6 feat(ui): add copilot-api install button and version display
- add CopilotInfo type and install mutation to useCopilot hook

- show version in status card when installed

- add Install button with loading state when not installed
2025-12-18 02:27:35 -05:00
kaitranntt 5b3d56548a feat(dashboard): add error log viewer for CLIProxy diagnostics
Add ErrorLogsMonitor component to Home page that displays CLIProxyAPI
error logs when requests fail. Users can now diagnose why success rates
drop by viewing detailed error log contents.

Backend:
- Add fetchCliproxyErrorLogs/fetchCliproxyErrorLogContent in stats-fetcher
- Add GET /api/cliproxy/error-logs and /api/cliproxy/error-logs/:name routes
- Include path traversal protection for filename validation

Frontend:
- Add CliproxyErrorLog type and errorLogs API methods
- Add useCliproxyErrorLogs/useCliproxyErrorLogContent hooks
- Create ErrorLogsMonitor component with expandable log viewer
- Integrate into Home page below AuthMonitor

Closes #132
2025-12-18 02:15:35 -05:00
kaitranntt 63bdc3ae39 fix(copilot): widen sidebar and balance split-view layout
- Increase sidebar width from w-64 to w-80 (320px)
- Increase model name truncation from 100px to 160px
- Balance config form split-view to 50%/50%
2025-12-18 01:38:02 -05:00
kaitranntt 589cd2c2b7 feat(dashboard): add CLIProxy status widget with start button 2025-12-18 01:26:30 -05:00
kaitranntt 7886259c36 feat(copilot): redesign config form to match CLIProxy pattern
- Split-view layout (40% left / 60% right) matching CLIProxy design
- Left panel: Model Config tab with FlexibleModelSelector components,
  Settings tab, and Info tab
- Right panel: Raw JSON editor for copilot.settings.json
- Add preset buttons for quick model tier mapping
- Bidirectional sync between UI and raw JSON
- Simplify copilot.tsx page layout with narrower sidebar
2025-12-18 00:22:14 -05:00
kaitranntt 882792a4fb feat(copilot): add raw settings support to useCopilot hook
Add CopilotRawSettings interface and API functions for reading/writing
copilot.settings.json with conflict detection via expectedMtime.
2025-12-18 00:21:33 -05:00
kaitranntt 2e77646d60 fix(ui): add error state handling to API Profiles page
Adds proper error handling when useProfiles() hook fails to fetch data.
Previously, API errors would cause a blank screen as the component had
no error state handling. Now shows a user-friendly error message with
a retry button.

Fixes #125
2025-12-18 00:20:25 -05:00
kaitranntt 6b04532f41 feat(ui): add copilot dashboard page
- use-copilot.ts: React hook for copilot state management

- copilot-status-card.tsx: status display with auth/daemon controls

- copilot-config-form.tsx: configuration form with model selector

- copilot.tsx: main page combining status and config

- add /copilot route and sidebar navigation
2025-12-17 21:41:06 -05:00
kaitranntt 9028b742f8 feat(ui): add ClaudeKit badge and Sponsor buttons to navbar
- replace "CCS Config" header text with two promotional buttons
- add ClaudeKit badge with logo linking to claudekit.cc
- add Sponsor button with heart icon linking to GitHub Sponsors
- both buttons feature hover effects and consistent styling
- fix dark theme hover text visibility
2025-12-17 18:57:12 -05:00
kaitranntt ab4c95bac9 fix(ui): unify account card padding and fix SVG glow filter
- add filterUnits="userSpaceOnUse" to flow-glow filter for consistent rendering
- unify connector-side padding to p*-4 across all zones (top/bottom/left/right)
- previous: top pb-5, left pr-6, right pl-6, bottom no extra
- now: all zones have consistent 16px padding on connector side
2025-12-17 18:33:58 -05:00
kaitranntt 740f31b1b2 style(ui): use earthy sophisticated colors for flow connection lines
Replace generic gray connection lines with curated earthy palette
(Charcoal Brown, Forest Moss, Vintage Berry, Harvest Gold, Blue Slate,
Burnt Caramel) for more visually interesting bezier curves in account
flow visualization.
2025-12-17 18:14:35 -05:00
kaitranntt 572703f439 fix(ui): optimize bundle size and fix calendar crash
- optimize vite manualChunks to reduce bundle sizes
- update calendar to react-day-picker v9 API
- fix calendar crash by removing broken drag-to-select
- improve calendar UI with compact styling and better navigation
- resolve fast-refresh lint error by separating button variants
2025-12-17 18:04:50 -05:00
kaitranntt 2bf7992a8a feat(ui): extend privacy mode to blur cost/token values in analytics 2025-12-17 16:40:05 -05:00