Commit Graph
1215 Commits
Author SHA1 Message Date
kaitranntt 557926ffe3 fix(api): resolve route path mismatches
- Add /usage alias for /cliproxy/stats (frontend compatibility)
- Create account-routes.ts to fix /accounts/accounts double path
- Update index.ts to mount accountRoutes at /accounts
- Remove account code from profile-routes.ts
- Clean up unused imports in profile-routes.ts
2025-12-21 18:03:15 -05:00
kaitranntt e84df00740 fix(ui): correct cliproxy account API paths
- Change /cliproxy/accounts/* to /cliproxy/auth/accounts/*
- Fix 404 errors when managing CLIProxy accounts from dashboard
- Root cause: frontend called wrong endpoints for account management
2025-12-21 18:02:38 -05:00
kaitranntt 3bf9ebe32a feat(ui): add remote mode indicator to provider editor header
Shows "Remote" badge with Globe icon and "Traffic auto-routed to
remote server" message when remote CLIProxy mode is active.
2025-12-21 04:34:29 -05:00
semantic-release-bot a8bda073fb chore(release): 7.1.1 [skip ci]
## [7.1.1](https://github.com/kaitranntt/ccs/compare/v7.1.0...v7.1.1) (2025-12-21)

### Bug Fixes

* **hooks:** memoize return objects to prevent infinite render loops ([f15b989](https://github.com/kaitranntt/ccs/commit/f15b98950865c01ec6d8d846e3a197bb04e6cf6e))
* **settings:** memoize useSettingsActions to prevent infinite render loop ([4f75e10](https://github.com/kaitranntt/ccs/commit/4f75e105a9ab0c498fb1748829396d695836be65))

### Documentation

* update documentation for modularization phases 6-9 ([e45b46d](https://github.com/kaitranntt/ccs/commit/e45b46d20708e29e770307dbfcce33d84465f137))

### Code Refactoring

* **ui:** modularize analytics page into directory structure ([03d9bf7](https://github.com/kaitranntt/ccs/commit/03d9bf76c474f93f12fcc5dbdaa55c1f215b1e39))
* **ui:** modularize auth-monitor into directory structure ([8ead6fa](https://github.com/kaitranntt/ccs/commit/8ead6fa0bf05fc8d37563a618c473d7eae808920))
* **ui:** modularize settings page into directory structure ([104a404](https://github.com/kaitranntt/ccs/commit/104a40414437a4f32492e4bcc33fdfbbec386e2f))

### Tests

* **ui:** add vitest testing infrastructure with 99 unit tests ([3fca933](https://github.com/kaitranntt/ccs/commit/3fca9338f9a77ac202dde6095bf70b5094199888))
2025-12-21 09:30:01 +00:00
kaitranntt 4ee3100622 fix(cliproxy): respect user model settings in remote proxy mode
getRemoteEnvVars was ignoring user settings and always loading
models from base config. Now follows same priority as local mode:
1. Custom settings path (variant configs)
2. User settings file (~/.ccs/{provider}.settings.json)
3. Base config defaults

This fixes the issue where selecting Opus 4.5 in UI resulted in
Gemini 3 preview being loaded when using remote proxy mode.
2025-12-21 04:29:49 -05:00
Kai (Tam Nhu) Tran 8482aba6b1 Merge pull request #173 from kaitranntt/dev
feat(ui): modularize settings, analytics, auth-monitor pages with test infrastructure
2025-12-21 04:28:52 -05:00
github-actions[bot] 8340c3b0f2 chore(release): 7.1.0-dev.3 [skip ci] 2025-12-21 09:18:58 +00:00
kaitranntt f15b989508 fix(hooks): memoize return objects to prevent infinite render loops
Apply useMemo to hook returns that create new object references on each
render. This prevents downstream useEffect/useCallback dependencies from
detecting false changes and triggering re-execution.

Fixed hooks:
- PrivacyProvider: memoize context value and toggle callback
- useCopilot: wrap large return object with all dependencies
- useWebSocket: memoize status/connect/disconnect object
- useProjectSelection: memoize state and handlers object
- useCliproxyAuthFlow: memoize spread state with auth functions
- useAnalyticsPage: memoize apiOptions to stabilize query params
2025-12-21 04:17:32 -05:00
kaitranntt d86dfab2e7 feat(ui): show remote server info in ProxyStatusWidget
- Add remote mode detection via cliproxy-server-config query
- Display blue-themed "Remote Proxy" widget when remote enabled
- Show remote host and "Traffic auto-routed" message
- Hide local start/stop/restart controls in remote mode
2025-12-21 04:14:55 -05:00
github-actions[bot] b9e69965e2 chore(release): 7.1.0-dev.2 [skip ci] 2025-12-21 09:13:59 +00:00
kaitranntt a2d01bcc8a fix(cliproxy): load remote config from config.yaml for proxy resolution
- Import loadOrCreateUnifiedConfig to access cliproxy_server settings
- Pass remote/local config to resolveProxyConfig() function
- Enables CLI to detect remote mode from user's config.yaml
2025-12-21 04:13:57 -05:00
kaitranntt d0599e8d2c feat(cliproxy): add localhost URL rewriting for remote proxy mode
- Add rewriteLocalhostUrls() to detect and rewrite localhost URLs
- Support 127.0.0.1, localhost, 0.0.0.0 patterns
- Update getEffectiveEnvVars() to accept remoteRewriteConfig param
- Auto-rewrite saved settings URLs to remote server at runtime
2025-12-21 04:13:36 -05:00
kaitranntt 4f75e105a9 fix(settings): memoize useSettingsActions to prevent infinite render loop
- wrap return object in useMemo with all action callbacks as deps

- prevents new object reference on every render

- fixes Maximum update depth exceeded error on settings page
2025-12-21 04:09:13 -05:00
github-actions[bot] b8b9101466 chore(release): 7.1.0-dev.1 [skip ci] 2025-12-21 08:46:23 +00:00
kaitranntt e45b46d207 docs: update documentation for modularization phases 6-9
- mark settings, analytics, auth-monitor splits as complete
- add test infrastructure (99 tests, 90% threshold) to roadmap
- update codebase-summary.md with new modular structure
- add github issues backlog (13 issues categorized by priority)
- add future roadmap: multiple cliproxyapi, git worktree support
- update project-overview-pdr.md with v7.0 release items
- update system-architecture.md with new ui module structure
2025-12-21 03:45:02 -05:00
kaitranntt c3f72e6693 chore: add bunfig.toml and update gitignore for test config
- add bunfig.toml to scope bun test to ./tests/ only
- add ui test output directory to gitignore
- separates main (bun test) and UI (vitest) test runners
2025-12-21 03:29:12 -05:00
kaitranntt 3fca9338f9 test(ui): add vitest testing infrastructure with 99 unit tests
- add vitest, jsdom, testing-library, msw dependencies
- create test setup: vitest-setup.ts, test-utils.tsx, msw-handlers.ts
- add 99 unit tests covering settings, analytics, auth-monitor utils
- configure 90% coverage thresholds on pure-logic files
- add test scripts: test, test:run, test:coverage, test:ui
2025-12-21 03:28:34 -05:00
kaitranntt 8ead6fa0bf refactor(ui): modularize auth-monitor into directory structure
- split auth-monitor.tsx (465 lines) into modular components
- extract provider-card, summary-card, live-pulse, inline-stats-badge
- separate hooks, types, and utils for better maintainability
- export types from monitoring barrel
2025-12-21 03:27:53 -05:00
kaitranntt 03d9bf76c4 refactor(ui): modularize analytics page into directory structure
- split analytics.tsx (420 lines) into modular components
- extract analytics-header, charts-grid, cost-by-model-card
- add analytics-skeleton for loading states
- separate hooks, types, and utils
2025-12-21 03:27:15 -05:00
kaitranntt 104a404144 refactor(ui): modularize settings page into directory structure
- split settings.tsx (1,781 lines) into modular components
- extract hooks into separate files (context-hooks, use-*-config)
- create sections: websearch, proxy, globalenv with subcomponents
- add tab-navigation and section-skeleton components
- add settings-context.ts for state management
2025-12-21 03:26:40 -05:00
kaitranntt 883d9fa585 fix(ui): hide local paths in remote CLIProxy mode 2025-12-21 02:56:24 -05:00
kaitranntt 068d5772f2 fix(cliproxy): add gemini-cli provider mapping for remote auth 2025-12-21 02:37:36 -05:00
semantic-release-bot e8cb273ecb chore(release): 7.1.0 [skip ci]
## [7.1.0](https://github.com/kaitranntt/ccs/compare/v7.0.0...v7.1.0) (2025-12-21)

### Features

* **ui:** add visual feedback for WebSearch model auto-save ([eaf566b](https://github.com/kaitranntt/ccs/commit/eaf566beac65284d0809ca8a29f6ce2d03b79af8)), closes [#164](https://github.com/kaitranntt/ccs/issues/164)

### Bug Fixes

* **ci:** use commit-based changelog for dev release Discord notifications ([1129ec6](https://github.com/kaitranntt/ccs/commit/1129ec6ef570e7b922d2831c53bad83a68311b88))
* **ui:** add unsaved changes confirmation when switching profiles ([b790005](https://github.com/kaitranntt/ccs/commit/b790005c85e9f25fd14a14ac01b79e7562f1a1ea)), closes [#163](https://github.com/kaitranntt/ccs/issues/163)
* **ui:** fix profile switching and improve UX ([86d992f](https://github.com/kaitranntt/ccs/commit/86d992fce623a8378d5f53b1aff7b53d2f80e3c4))

### Documentation

* **readme:** add OpenRouter to built-in providers ([676929f](https://github.com/kaitranntt/ccs/commit/676929fc87c4cc450e3dc6e3f05ff60dfcead255))
* **standards:** add input state persistence patterns ([53a7ba8](https://github.com/kaitranntt/ccs/commit/53a7ba8d3ffe81f87306e84357fce4f6ec9d7135)), closes [#165](https://github.com/kaitranntt/ccs/issues/165)
2025-12-21 07:11:07 +00:00
Kai (Tam Nhu) Tran fe46f4dfd8 Merge pull request #172 from kaitranntt/dev
feat(ui): improve input state persistence and add save feedback
2025-12-21 02:10:02 -05:00
github-actions[bot] 87b9f81aab chore(release): 7.0.0-dev.5 [skip ci] 2025-12-21 07:00:15 +00:00
kaitranntt 53a7ba8d3f docs(standards): add input state persistence patterns
- Pattern 1: Key-based remounting

- Pattern 2: Unsaved changes confirmation

- Pattern 3: Auto-save with visual feedback

Closes #165
2025-12-21 01:59:10 -05:00
github-actions[bot] 8d4afc59ad chore(release): 7.0.0-dev.4 [skip ci] 2025-12-21 06:52:44 +00:00
Kai (Tam Nhu) Tran 0cd8d06b32 Merge pull request #171 from kaitranntt/kai/feat/websearch-model-inputs
feat(ui): add visual feedback for WebSearch model auto-save
2025-12-21 01:51:43 -05:00
kaitranntt eaf566beac feat(ui): add visual feedback for WebSearch model auto-save
- Add 'Saved' indicator with checkmark for Gemini/OpenCode model inputs

- Show indicator for 2 seconds after successful save on blur

- Uses fade-in animation for smooth UX

Closes #164
2025-12-21 01:47:18 -05:00
github-actions[bot] 69d4316821 chore(release): 7.0.0-dev.3 [skip ci] 2025-12-21 06:36:31 +00:00
Kai (Tam Nhu) Tran c3595432cb Merge pull request #170 from kaitranntt/kai/feat/standardize-input-state-persistence
fix(ui): add unsaved changes confirmation when switching profiles
2025-12-21 01:35:28 -05:00
kaitranntt 86d992fce6 fix(ui): fix profile switching and improve UX
- Add key prop to ProfileEditor to force remount on profile change

- Reset editorHasChanges on discard confirmation

- Add text-white to destructive dialog button

- Change OpenRouter default model to claude-opus-4.5
2025-12-21 01:20:57 -05:00
github-actions[bot] 6d49c0068b chore(release): 7.0.0-dev.2 [skip ci] 2025-12-21 06:16:02 +00:00
kaitranntt 1129ec6ef5 fix(ci): use commit-based changelog for dev release Discord notifications
- dev-release.sh: save release notes to .dev-release-info.json
- send-discord-release.cjs: read from generated file for dev releases
- add .dev-release-info.json to .gitignore
2025-12-21 01:14:49 -05:00
kaitranntt b790005c85 fix(ui): add unsaved changes confirmation when switching profiles
- Add onHasChangesUpdate callback to ProfileEditor

- Track editor dirty state in ApiPage parent

- Show confirmation dialog before discarding unsaved changes

- Handle edge case for 'New' profile button

Closes #163
2025-12-21 01:05:23 -05:00
github-actions[bot] bf65de55cf chore(release): 7.0.0-dev.1 [skip ci] 2025-12-21 06:04:07 +00:00
kaitranntt 676929fc87 docs(readme): add OpenRouter to built-in providers
- add OpenRouter row to providers table

- add OpenRouter integration section with v7.0.0 features

- add screenshot for OpenRouter API profiles
2025-12-21 01:01:16 -05:00
kaitranntt cdb465342e fix(cliproxy): address code review findings for remote routing
- Add runtime API response validation in remote-auth-fetcher
- Add AbortController cleanup to prevent state updates after unmount
- Validate postMessage origin matches iframe src before sending creds
- Mask auth token display (show ***last4) for security
- Reset error/connected state on refresh
- Fix port default to use protocol-based (443 for https, 80 for http)
- Normalize path in buildProxyUrl to ensure leading slash
- Add fallback for undefined email (default to 'Unknown')
- Extract timeout constant (REMOTE_FETCH_TIMEOUT_MS)
- Remove unused RemoteAuthFilesResponse interface
2025-12-21 00:42:54 -05:00
kaitranntt bfa55e041c feat(ui): dynamic control panel embed for remote CLIProxy
- Use React Query to fetch cliproxy_server config
- Build URLs dynamically based on remote/local mode
- Add Globe icon and Remote badge indicator
- Show context-aware error messages for remote failures
2025-12-21 00:42:54 -05:00
kaitranntt 17bb6f9836 feat(cliproxy): add remote routing for stats and auth endpoints
- Refactor stats-fetcher.ts: 5 functions now use getProxyTarget()
- Add remote-auth-fetcher.ts: fetch auth status from remote /v0/management/auth-files
- Update cliproxy-auth-routes.ts: branch on isRemote for GET routes
- Return 501 for account management in remote mode (unsupported)
2025-12-21 00:42:54 -05:00
kaitranntt 9e2fd096e4 feat(cliproxy): add proxy target resolver for remote/local routing
- add ProxyTarget interface with host, port, protocol, authToken, isRemote
- implement getProxyTarget() to resolve target from unified config
- add buildProxyUrl() and buildProxyHeaders() utilities
- handle optional auth token (empty = no Authorization header)
2025-12-21 00:42:54 -05:00
semantic-release-bot 3ec8703be0 chore(release): 7.0.0 [skip ci]
## [7.0.0](https://github.com/kaitranntt/ccs/compare/v6.7.1...v7.0.0) (2025-12-21)

### ⚠ BREAKING CHANGES

* **install:** GLM/GLMT/Kimi profiles no longer auto-created

- remove glm.settings.json auto-creation
- remove glmt.settings.json auto-creation
- remove kimi.settings.json auto-creation
- config.json now starts with empty profiles
- users create via: ccs api create --preset glm
- or via UI: Profile Create Dialog → Provider Presets
- existing profiles preserved for backward compatibility

### Features

* **api:** unify profile management with config-aware services ([4c74e92](https://github.com/kaitranntt/ccs/commit/4c74e92cc46afed9c8232944a2a443709b130a2c))
* **cli:** add --preset option to ccs api create command ([418d121](https://github.com/kaitranntt/ccs/commit/418d121577098722a35b060a37388ea2d267dffd))
* **cli:** add interactive OpenRouter model picker for api create ([d193626](https://github.com/kaitranntt/ccs/commit/d193626e3bfb8962809e2a6daf9697d302a70ff7))
* **install:** remove auto-creation of GLM/GLMT/Kimi profiles ([f96116d](https://github.com/kaitranntt/ccs/commit/f96116d280d1addcaf5ea5ba5e605f8a3f058ad7))
* **openrouter:** prioritize Exacto models for better agentic performance ([ebc8ee2](https://github.com/kaitranntt/ccs/commit/ebc8ee2638a10500c85f0af862f9d99589429b89))
* **proxy:** improve remote proxy UX defaults ([116b6a1](https://github.com/kaitranntt/ccs/commit/116b6a15b0bf7db3a11fb428706dde126814004d))
* **ui:** add dynamic newest models detection for OpenRouter ([a1cbd4d](https://github.com/kaitranntt/ccs/commit/a1cbd4d92397bc15a9cb627bda5cd360603a2bf5))
* **ui:** add OpenRouter badge to API Profiles sidebar item ([a08aef9](https://github.com/kaitranntt/ccs/commit/a08aef9fb79c8cf8c1109414394da43d6e35db31))
* **ui:** add OpenRouter model catalog core infrastructure ([80beb1d](https://github.com/kaitranntt/ccs/commit/80beb1dadafff283c713d8a7ae556e06a7935882))
* **ui:** add OpenRouter model picker and tier mapping components ([3cd21bb](https://github.com/kaitranntt/ccs/commit/3cd21bb67b1e357992e662fe666bd35a4062de04))
* **ui:** add provider preset categories with helper function ([10cfe0f](https://github.com/kaitranntt/ccs/commit/10cfe0fefad9892d1e6314122027dc05bea1a6bf))
* **ui:** add provider presets and OpenRouter promo components ([9c90e1d](https://github.com/kaitranntt/ccs/commit/9c90e1dc2cdc8aa11bb82ae4b337f7fed2f4c373))
* **ui:** add streamlined OpenRouter profile editor ([7788137](https://github.com/kaitranntt/ccs/commit/7788137f1c407854d7d8aa5c10c18fd98dbafa2f))
* **ui:** add value input for new environment variables ([f947aeb](https://github.com/kaitranntt/ccs/commit/f947aeb21b0a3a73c8b401de263deb68c69769ce))
* **ui:** integrate OpenRouter model picker into profile editor ([677f9d1](https://github.com/kaitranntt/ccs/commit/677f9d1e72990e51ed88e00b228369c8be520bbe))
* **ui:** rewrite profile create dialog with provider presets ([adcc323](https://github.com/kaitranntt/ccs/commit/adcc3235f0fcd328f3729125e5c5988f9db0937d))

### Bug Fixes

* **ci:** use custom dev versioning to preserve stable version coupling ([dce4b36](https://github.com/kaitranntt/ccs/commit/dce4b36fc658cb1a692f44152002fe5e1e79f24f))
* **cliproxy:** correct remote proxy URL building for default port ([294d8d5](https://github.com/kaitranntt/ccs/commit/294d8d55e517ce064601ec7fd54827da61e0d0f2))
* **cliproxy:** improve remote proxy error messages ([55464c5](https://github.com/kaitranntt/ccs/commit/55464c5c5cb67b1cc4c2352130384dc6bc013f4c)), closes [#142](https://github.com/kaitranntt/ccs/issues/142)
* **cliproxy:** use /v1/models for remote proxy health check ([5e1d290](https://github.com/kaitranntt/ccs/commit/5e1d290865876a7e002b1e6c3c2911e1ac7e49b2)), closes [#142](https://github.com/kaitranntt/ccs/issues/142)
* **config:** add missing cliproxy_server section to YAML serialization ([b322203](https://github.com/kaitranntt/ccs/commit/b32220364eb3b023b6d62fd12a4cc4cd60da85e5))
* **openrouter:** add ANTHROPIC_API_KEY="" default for OpenRouter profiles ([70bc44e](https://github.com/kaitranntt/ccs/commit/70bc44eb11a28ec3e338d9ef45d33d9beaac6873))
* **openrouter:** correct ANTHROPIC_BASE_URL to https://openrouter.ai/api ([7d4961e](https://github.com/kaitranntt/ccs/commit/7d4961e7a955dd48075aae7e215b3f0aaf4367ef))
* **openrouter:** show all env vars except API key in Additional Variables ([f41d361](https://github.com/kaitranntt/ccs/commit/f41d361fe547c0201b4d49c542391b4e5d96b93e))
* **ui:** deduplicate API key and restore add variable input ([3f7add5](https://github.com/kaitranntt/ccs/commit/3f7add5c10be5485567e2462754c145e94c19d78))
* **ui:** model selection now updates all tiers correctly ([723ce28](https://github.com/kaitranntt/ccs/commit/723ce284314272f05b0413c3f9fdd4bcdb298618))
* **ui:** resolve Radix ScrollArea viewport overflow ([2b6600a](https://github.com/kaitranntt/ccs/commit/2b6600abd74d369dfd245b8f77c26786006e46cb))
* **ui:** show OpenRouterQuickStart by default on API page ([05380e2](https://github.com/kaitranntt/ccs/commit/05380e21b435d09d0105bee3868d4c73028e558d))
* **ui:** use current input values for test connection and persist across tabs ([12b534c](https://github.com/kaitranntt/ccs/commit/12b534cc495337f2c6e24884cde7d7296a34f380)), closes [#142](https://github.com/kaitranntt/ccs/issues/142) [#163](https://github.com/kaitranntt/ccs/issues/163) [#164](https://github.com/kaitranntt/ccs/issues/164) [#165](https://github.com/kaitranntt/ccs/issues/165)
* **update:** correct dev version comparison semantic ([df77745](https://github.com/kaitranntt/ccs/commit/df77745eca747e6877c754f0002a4ba9fd50eb85))

### Code Refactoring

* **config:** remove secrets.yaml architecture ([4f4ab43](https://github.com/kaitranntt/ccs/commit/4f4ab43eb39576b5bd3dfc16ced306d0653e72f0))
* **ui:** rename /api route to /providers ([9382278](https://github.com/kaitranntt/ccs/commit/93822787045188e3e006b8671ea5ae24f94459ce))
* **ui:** reorganize profile create dialog with preset categories ([96310dd](https://github.com/kaitranntt/ccs/commit/96310dd1acd5d6265cd2d68d970b79409d988c1f))
* **ui:** replace hardcoded orange colors with accent tokens ([b9f6823](https://github.com/kaitranntt/ccs/commit/b9f6823fc93c42f0f9af85750386149635428aa0))

### Tests

* **npm:** update tests for preset-based profile creation ([de45fa0](https://github.com/kaitranntt/ccs/commit/de45fa0da9d1345dff5871a71af7bbedb235076f))
2025-12-21 05:13:58 +00:00
Kai (Tam Nhu) Tran 1d5c54a2fb Merge pull request #169 from kaitranntt/dev
feat(openrouter): OpenRouter model catalog integration and UI improvements
2025-12-21 00:12:59 -05:00
github-actions[bot] 4e54da0688 chore(release): 6.7.1-dev.8 [skip ci] 2025-12-21 05:11:07 +00:00
kaitranntt a08aef9fb7 feat(ui): add OpenRouter badge to API Profiles sidebar item
Shows compact OpenRouter indicator badge with icon and tooltip
(349+ models). Badge colors adapt for proper contrast on hover
and active states in both light and dark themes.
2025-12-21 00:08:45 -05:00
github-actions[bot] e69e47be85 chore(release): 6.7.1-dev.7 [skip ci] 2025-12-21 04:59:50 +00:00
Kai (Tam Nhu) Tran 13dd5614a2 Merge pull request #168 from kaitranntt/kai/feat/openrouter-model-catalog
feat(openrouter): add model catalog integration with searchable picker and tier mapping
2025-12-20 23:58:50 -05:00
kaitranntt f41d361fe5 fix(openrouter): show all env vars except API key in Additional Variables
Only hide ANTHROPIC_AUTH_TOKEN (has dedicated input). Show all other
env vars (BASE_URL, MODEL, tier models, API_KEY, etc.) in the
"Additional Variables" section for full visibility.
2025-12-20 23:47:14 -05:00
kaitranntt 70bc44eb11 fix(openrouter): add ANTHROPIC_API_KEY="" default for OpenRouter profiles
Per OpenRouter requirements, explicitly blank out the Anthropic API key
to prevent conflicts when using OpenRouter's API. The key is visible in
the "Additional Variables" section of the profile editor.
2025-12-20 23:43:52 -05:00
kaitranntt ebc8ee2638 feat(openrouter): prioritize Exacto models for better agentic performance
- Add isExacto field to CategorizedModel for models with :exacto suffix
- Add sortModelsByPriority function (Free > Exacto > Regular)
- Apply priority sorting within each category in model picker
- Add visual "Exacto" badge (green outline) for exacto variants

Exacto models are OpenRouter's specialized variants optimized for
tool use and agentic behaviors, recommended for Claude Code.
2025-12-20 23:38:07 -05:00