Commit Graph
1512 Commits
Author SHA1 Message Date
kaitranntt fc23afdfc7 feat(cliproxy): add auto_sync config option
- export sync module from cliproxy barrel
- add auto_sync field to CLIProxyConfig interface
2026-01-28 11:57:22 -05:00
kaitranntt 56500fee98 feat(cliproxy): add sync API routes
- add /api/cliproxy/sync endpoints for local sync
- add /api/cliproxy/sync/aliases for model alias management
- add /api/cliproxy/sync/auto-sync for watcher toggle
- separate try-catch for config save vs watcher restart
2026-01-28 11:57:22 -05:00
kaitranntt cb6c21216d feat(cliproxy): add sync and alias CLI commands
- add `ccs cliproxy sync` command for manual sync
- add `ccs cliproxy alias` command for model alias management
- support --dry-run and --verbose flags
- integrate with cliproxy subcommand router
2026-01-28 11:57:22 -05:00
kaitranntt 9de2682062 feat(cliproxy): add local config sync module
- add profile mapper to transform CCS profiles to ClaudeKey format
- add model alias configuration with defaults for glm/kimi/qwen
- add local config sync to write claude-api-key section
- add auto-sync watcher with debouncing for profile changes
- include null config handling and temp file cleanup
2026-01-28 11:57:22 -05:00
kaitranntt 4cc89eaf87 feat(cliproxy): add Management API client for CLIProxy
- add types for ClaudeKey, ClaudeModel, HealthStatus
- add HTTP client for Management API endpoints
- support GET/PUT/PATCH/DELETE operations
2026-01-28 11:57:22 -05:00
semantic-release-bot ae11603de7 chore(release): 7.29.0 [skip ci]
## [7.29.0](https://github.com/kaitranntt/ccs/compare/v7.28.2...v7.29.0) (2026-01-28)

### Features

* **cliproxy:** add Claude (Anthropic) OAuth provider support ([28d8bd8](https://github.com/kaitranntt/ccs/commit/28d8bd84a5ac912b79416aeced95f74fd71876bb)), closes [#380](https://github.com/kaitranntt/ccs/issues/380)
* skip local OAuth when using remote proxy with auth token ([1f5d119](https://github.com/kaitranntt/ccs/commit/1f5d11930ee19c0f00b46d7994ea99c7be8e55c6))

### Bug Fixes

* add claude provider to statsProviderMap, UI types, and provider arrays ([4a2abc7](https://github.com/kaitranntt/ccs/commit/4a2abc74cac93e17ee12fab3fcf8fc0693552347))
* **cliproxy:** add Claude to all provider lists for sidebar display ([d212995](https://github.com/kaitranntt/ccs/commit/d2129957d7e954701be973725545f475711d0468))
* **cliproxy:** address PR review feedback ([2091a90](https://github.com/kaitranntt/ccs/commit/2091a90b7710e7cb0b565577a5e659473126a541)), closes [#D97757](https://github.com/kaitranntt/ccs/issues/D97757)
* **cliproxy:** improve skip-local-auth edge case handling ([21e819b](https://github.com/kaitranntt/ccs/commit/21e819b59062b77c2686ecc5f24e9c3436e42f84))
* **cliproxy:** use correct --claude-login flag for Claude OAuth ([8017ce8](https://github.com/kaitranntt/ccs/commit/8017ce8f8639ffc282203d6809091df83e0c8f18)), closes [#382](https://github.com/kaitranntt/ccs/issues/382)
* replace hardcoded provider validation arrays with CLIPROXY_PROFILES import ([9cd9c42](https://github.com/kaitranntt/ccs/commit/9cd9c423e929579c86da3f409d74927c3c7dedc1)), closes [#382](https://github.com/kaitranntt/ccs/issues/382)
* **test:** use correct provider name 'ghcp' instead of 'copilot' ([838cd1d](https://github.com/kaitranntt/ccs/commit/838cd1d460de68acb571bb44bc12f91bd0636ff7))
* **ui:** add iFlow to PROVIDER_ASSETS + sync validation test ([5c62e06](https://github.com/kaitranntt/ccs/commit/5c62e06d0236b5080ccfb3ca2ff55407cbb414e1)), closes [#384](https://github.com/kaitranntt/ccs/issues/384)
* **ui:** truncate long account emails in provider editor ([a9c5520](https://github.com/kaitranntt/ccs/commit/a9c5520b8b4b7d49d1afe0e63b4facab3142db1b))

### Code Refactoring

* **cliproxy:** reorder providers - Antigravity first, then Claude ([b385ab1](https://github.com/kaitranntt/ccs/commit/b385ab131d2b179c7b7bd014859f9118afd6ce5c))
* **cliproxy:** use CLIPROXY_PROFILES for provider arrays (DRY) ([9fd9395](https://github.com/kaitranntt/ccs/commit/9fd93955880fd1b90d15f45d9738d413d04769ca)), closes [#384](https://github.com/kaitranntt/ccs/issues/384)
* **oauth:** derive auth-code providers from OAUTH_FLOW_TYPES (DRY) ([c713d48](https://github.com/kaitranntt/ccs/commit/c713d48d08af5044cb0fab4505365fd98e31b9d6)), closes [#384](https://github.com/kaitranntt/ccs/issues/384)
* **ui:** centralize provider list in provider-config.ts (DRY) ([5a4c8e0](https://github.com/kaitranntt/ccs/commit/5a4c8e009ce1cc355d6fa2f05001cab6c9b684c4))
2026-01-28 03:28:46 +00:00
Kai (Tam Nhu) TranandGitHub 110e82756c Merge pull request #384 from kaitranntt/dev
feat(cliproxy): Claude OAuth provider + skip-local-auth improvements
2026-01-27 22:27:46 -05:00
github-actions[bot] 6e560b78c4 chore(release): 7.28.2-dev.5 [skip ci] 2026-01-28 03:26:46 +00:00
kaitranntt c713d48d08 refactor(oauth): derive auth-code providers from OAUTH_FLOW_TYPES (DRY)
- Update checkAuthCodePorts() to filter from CLIPROXY_PROFILES

- Update header comment to list all OAuth ports including Claude

- Addresses PR #384 review round 3
2026-01-27 22:25:31 -05:00
kaitranntt 5c62e06d02 fix(ui): add iFlow to PROVIDER_ASSETS + sync validation test
- Add iflow.png to PROVIDER_ASSETS map

- Add backend-ui-provider-arrays-sync.test.ts to catch mismatches

- Addresses PR #384 review: dual source of truth + missing iFlow
2026-01-27 22:20:15 -05:00
github-actions[bot] ebc42c9457 chore(release): 7.28.2-dev.4 [skip ci] 2026-01-28 03:06:09 +00:00
kaitranntt 9fd9395588 refactor(cliproxy): use CLIPROXY_PROFILES for provider arrays (DRY)
- Replace hardcoded arrays in token-manager.ts, token-expiry-checker.ts

- Replace hardcoded arrays in account-manager.ts, oauth-port-diagnostics.ts

- Addresses PR #384 code review feedback
2026-01-27 22:04:46 -05:00
github-actions[bot] b3cde80d0e chore(release): 7.28.2-dev.3 [skip ci] 2026-01-28 02:43:55 +00:00
kaitranntt a9c5520b8b fix(ui): truncate long account emails in provider editor
- Add min-w-0 flex-1 for proper text overflow

- Add truncate class to prevent layout break
2026-01-27 21:40:29 -05:00
kaitranntt 8017ce8f86 fix(cliproxy): use correct --claude-login flag for Claude OAuth
- CLIProxyAPI expects --claude-login, not --anthropic-login

- Fixes 'CLIProxy auth exited with code 2' error

Closes #382
2026-01-27 21:39:19 -05:00
github-actions[bot] 409ad67afb chore(release): 7.28.2-dev.2 [skip ci] 2026-01-28 02:27:20 +00:00
Kai (Tam Nhu) TranandGitHub eba0ed277b Merge pull request #383 from kaitranntt/fix/claude-provider-validation
fix(cliproxy): add claude provider to all validation arrays and UI types
2026-01-27 21:26:22 -05:00
kaitranntt 5a4c8e009c refactor(ui): centralize provider list in provider-config.ts (DRY)
- Add CLIPROXY_PROVIDERS array as single source of truth for UI
- Add CLIProxyProvider type and isValidProvider() helper
- Update api-client.ts to use CLIProxyProvider type
- Update cliproxy-dialog.tsx to import from provider-config
- Update cliproxy-header.tsx to use CLIPROXY_PROVIDERS
- Update use-cliproxy-auth-flow.ts to use isValidProvider()
- Update wizard constants to use typed provider info

Adding a new provider now only requires updating:
- Backend: src/auth/profile-detector.ts (CLIPROXY_PROFILES)
- UI: ui/src/lib/provider-config.ts (CLIPROXY_PROVIDERS)
- UI wizard: ui/src/components/setup/wizard/constants.ts (PROVIDER_INFO)
2026-01-27 21:07:26 -05:00
kaitranntt 4a2abc74ca fix: add claude provider to statsProviderMap, UI types, and provider arrays
Fixes remaining edge cases from #382:
- Add anthropic/claude mapping to statsProviderMap in cliproxy-auth-routes
- Add 'claude' case to provider-refreshers switch statement
- Add 'claude' to 4 UI type definitions in api-client.ts
- Add 'claude' to cliproxy-dialog providers array and options
- Add 'claude' to use-cliproxy-auth-flow VALID_PROVIDERS
- Fix wizard index.tsx type cast to include all 8 providers
2026-01-27 21:02:34 -05:00
kaitranntt 9cd9c423e9 fix: replace hardcoded provider validation arrays with CLIPROXY_PROFILES import
Closes #382

Replace duplicate hardcoded provider validation arrays across three route files
with a single import from CLIPROXY_PROFILES constant. This DRY fix eliminates
code duplication and ensures provider validation is consistent across all routes.

Files updated:
- account-routes.ts
- cliproxy-auth-routes.ts
- cliproxy-stats-routes.ts

Reduces code by 21 lines while improving maintainability.
2026-01-27 20:50:24 -05:00
github-actions[bot] c4ec326530 chore(release): 7.28.2-dev.1 [skip ci] 2026-01-28 01:29:08 +00:00
Kai (Tam Nhu) TranandGitHub c3130ea314 Merge pull request #381 from kaitranntt/feat/claude-oauth
feat(cliproxy): add Claude (Anthropic) OAuth provider support
2026-01-27 20:28:07 -05:00
kaitranntt 2091a90b77 fix(cliproxy): address PR review feedback
- Remove claude from PLUS_ONLY_PROVIDERS (Claude works with normal CLIProxy too)
- Fix color inconsistency: use #D97757 to match SVG brand color
- Add iflow to checkAuthCodePorts (pre-existing issue, fixed opportunistically)
2026-01-27 20:24:01 -05:00
kaitranntt b385ab131d refactor(cliproxy): reorder providers - Antigravity first, then Claude 2026-01-27 20:17:10 -05:00
kaitranntt d2129957d7 fix(cliproxy): add Claude to all provider lists for sidebar display
Claude was missing from:
- getAllAuthStatus() providers array in token-manager.ts
- PROVIDER_ASSETS, PROVIDER_COLORS, PROVIDER_NAMES in provider-config.ts
- PROVIDERS array in setup wizard constants.ts
- PLUS_ONLY_PROVIDERS in proxy settings
2026-01-27 20:14:22 -05:00
kaitranntt 28d8bd84a5 feat(cliproxy): add Claude (Anthropic) OAuth provider support
Add Claude as a first-class OAuth provider in CCS CLI and dashboard.
Backend support already exists in CLIProxyAPIPlus (port 54545).

Changes:
- Add 'claude' to CLIProxyProvider type and profile detector
- Add Claude OAuth config (port 54545, --anthropic-login flag)
- Add Claude to oauth-port-diagnostics flow types
- Add Claude token discovery prefixes (claude-, anthropic-)
- Add Claude model catalog (Opus 4.5, Sonnet 4.5/4, Haiku 4.5)
- Add Claude logo and provider display name
- Update variant config types and adapters

Closes #380
2026-01-27 15:43:21 -05:00
github-actions[bot] 687f2e6541 chore(sync): merge main into dev after release [skip ci]
# Conflicts:
#	package.json
2026-01-27 20:13:19 +00:00
semantic-release-bot 441dd0b513 chore(release): 7.28.2 [skip ci]
## [7.28.2](https://github.com/kaitranntt/ccs/compare/v7.28.1...v7.28.2) (2026-01-27)

### Bug Fixes

* **websearch:** add shell option for Windows spawnSync compatibility ([3c534f4](https://github.com/kaitranntt/ccs/commit/3c534f48cb60448875c02bc0a8444277ca7c89eb)), closes [#378](https://github.com/kaitranntt/ccs/issues/378)
2026-01-27 20:12:47 +00:00
Kai (Tam Nhu) TranandGitHub 415b8cc8cb Merge pull request #379 from ruan-cat/fix/websearch-windows-spawnSync
fix(websearch): add shell option for Windows spawnSync compatibility
2026-01-27 15:11:42 -05:00
ruan-catandCursor 3c534f48cb fix(websearch): add shell option for Windows spawnSync compatibility
On Windows, globally installed CLI tools via npm/pnpm are .cmd/.bat
batch files, not real .exe executables. Node.js spawnSync() without
the shell option cannot execute these files and returns ENOENT error.

Changes:
- Extract isWindows as a global constant at file top
- Add shell: isWindows to all CLI execution spawnSync calls
- Remove duplicate isWindows declaration in isCliAvailable()

Fixes #378

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-28 02:45:22 +08:00
github-actions[bot] 5e398ff2f9 chore(release): 7.28.1-dev.1 [skip ci] 2026-01-26 21:27:29 +00:00
Kai (Tam Nhu) TranandGitHub d6e187a04d Merge pull request #375 from shunkakinoki/feat/skip-oauth-for-remote-proxy
feat: skip local OAuth when using remote proxy with auth token
2026-01-26 16:26:26 -05:00
kaitranntt 838cd1d460 fix(test): use correct provider name 'ghcp' instead of 'copilot' 2026-01-26 16:19:56 -05:00
kaitrannttandShun Kakinoki 21e819b590 fix(cliproxy): improve skip-local-auth edge case handling
- Validate authToken with trim() to reject whitespace-only values
- Show broken model warning for both remote and local modes
- Add context-aware messaging for remote proxy users
- Add comprehensive test coverage for authToken edge cases:
  - Whitespace-only strings
  - Null values
  - Tabs/newlines
  - Tokens with leading/trailing whitespace

Co-authored-by: Shun Kakinoki <shunkakinoki@gmail.com>
2026-01-26 16:16:23 -05:00
semantic-release-bot 7fbe6b2b54 chore(release): 7.28.1 [skip ci]
## [7.28.1](https://github.com/kaitranntt/ccs/compare/v7.28.0...v7.28.1) (2026-01-26)

### Bug Fixes

* **cliproxy:** pin version to 6.7.25, add disable-cooling ([fb77d72](https://github.com/kaitranntt/ccs/commit/fb77d72a3080d0fa096247c71a9cc1336445aa38))
* **websearch:** stop polluting global ~/.claude/settings.json with hooks ([0216341](https://github.com/kaitranntt/ccs/commit/0216341b2c45e0b0387947f30213d277e1893584))
2026-01-26 20:02:10 +00:00
Kai (Tam Nhu) TranandGitHub 3b3614b822 Merge pull request #377 from kaitranntt/dev
fix(websearch): stop polluting global settings with hooks
2026-01-26 15:01:02 -05:00
github-actions[bot] 3ae959122c chore(release): 7.28.0-dev.2 [skip ci] 2026-01-26 19:53:30 +00:00
kaitranntt 0216341b2c fix(websearch): stop polluting global ~/.claude/settings.json with hooks
Remove global hook registration from installWebSearchHook() - now only
copies hook file to ~/.ccs/hooks/. Hook registration handled by
ensureProfileHooks() which writes to per-profile settings.

Changes:
- hook-installer.ts: Remove ensureHookConfig() call
- ccs.ts: Remove redundant installWebSearchHook() call
- hook-config.ts: Add getClaudeSettingsPath() for test isolation
2026-01-26 14:51:51 -05:00
github-actions[bot] 60e7441246 chore(release): 7.28.0-dev.1 [skip ci] 2026-01-26 19:16:24 +00:00
Kai (Tam Nhu) TranandGitHub 6d619bc66f Merge pull request #376 from kaitranntt/kai/fix/cliproxy-pin-6725
fix(cliproxy): pin version to 6.7.25, add disable-cooling
2026-01-26 14:15:23 -05:00
kaitranntt fb77d72a30 fix(cliproxy): pin version to 6.7.25, add disable-cooling
- Update fallbackVersion: 6.7.8 → 6.7.25 (original)
- Update fallbackVersion: 6.7.8-0 → 6.7.25-0 (plus)
- Add disable-cooling: true to generated config
- Bump CLIPROXY_CONFIG_VERSION to 5 for regeneration
2026-01-26 14:12:14 -05:00
Shun Kakinoki 1f5d11930e feat: skip local OAuth when using remote proxy with auth token
When --proxy-host and --proxy-auth-token are provided, the remote proxy
handles authentication via its own OAuth sessions. This change skips:

- Local OAuth check/trigger
- Preflight quota check (managed by remote server)
- Model configuration prompts (configured on remote server)
- Broken model warnings (model selection is remote)

This enables headless CI/CD usage without requiring pre-cached
CCS_SESSIONS when a remote proxy with auth token is available.
2026-01-26 16:25:24 +09:00
semantic-release-bot 808be31024 chore(release): 7.28.0 [skip ci]
## [7.28.0](https://github.com/kaitranntt/ccs/compare/v7.27.0...v7.28.0) (2026-01-26)

### Features

* **cli:** implement --uninstall handler ([c44a5c2](https://github.com/kaitranntt/ccs/commit/c44a5c221f2046b84e6a556f0ffed706964dac6f))
* **cli:** inject hooks into profile settings on launch ([0099ab5](https://github.com/kaitranntt/ccs/commit/0099ab5a1c6d3201850b44bc51b06ceb8847f1d2))
* **npm:** add postuninstall script ([4f28de9](https://github.com/kaitranntt/ccs/commit/4f28de9c90cbd8b6bacbd6cf73b3f664db64eee3))
* **websearch:** add per-profile hook injection module ([242ab76](https://github.com/kaitranntt/ccs/commit/242ab7645384516db0c05c7139ae652733acf271))
* **websearch:** add removeHookConfig function ([9159aa5](https://github.com/kaitranntt/ccs/commit/9159aa52cbe99c0820c30a19843043ea141c1106)), closes [#317](https://github.com/kaitranntt/ccs/issues/317)
* **websearch:** call removeHookConfig on uninstall ([fc4d987](https://github.com/kaitranntt/ccs/commit/fc4d987d205bb2bd86d2cf2698858f052a740cce))
* **websearch:** inject hooks on profile creation ([fca8dbd](https://github.com/kaitranntt/ccs/commit/fca8dbd6cfdcb8a229051b840733b0769e61368a))

### Bug Fixes

* address PR [#373](https://github.com/kaitranntt/ccs/issues/373) review feedback ([e98a92f](https://github.com/kaitranntt/ccs/commit/e98a92fded2eeb32cd74ee25279b59e51237c67a))
* address PR review feedback ([cd7a112](https://github.com/kaitranntt/ccs/commit/cd7a1121d4f0072a4b15dc11b4864ec3aad26758))
* **config:** persist setup_completed flag to YAML file ([a8c46cc](https://github.com/kaitranntt/ccs/commit/a8c46cc8ed6743f3cfb07bbe621b644c9b2d6830))
* **isolation:** add getCcsDir/getCcsHome to more files ([6a2c829](https://github.com/kaitranntt/ccs/commit/6a2c82917dea1fb7c5c7a9e4e134ac3227e0edaa))
* **isolation:** use getCcsDir() for test isolation ([9b61f53](https://github.com/kaitranntt/ccs/commit/9b61f5318eedfd1f1a25ec5f3f3a39619174567b))
* **setup:** persist setup_completed flag to prevent repeated first-time notice ([85e41a5](https://github.com/kaitranntt/ccs/commit/85e41a56e94e17ab7aeb729f50404eb6c0708df9))
* **websearch:** use getCcsDir() for test isolation ([b33674b](https://github.com/kaitranntt/ccs/commit/b33674b3b225dd8d07fa48f916c3400cd0685dec))

### Code Refactoring

* **uninstall:** stop modifying global settings.json ([ba1fb7e](https://github.com/kaitranntt/ccs/commit/ba1fb7eeb3855db50eff5cfb5999d77ffd66f17f))
* **websearch:** address PR review recommendations ([21b18d0](https://github.com/kaitranntt/ccs/commit/21b18d0c4e7dbdf9e7070458ec5c5fb54ac6a410))

### Tests

* **setup:** add unit tests for setup_completed flag detection ([596a9c6](https://github.com/kaitranntt/ccs/commit/596a9c68439a2c668a7c6243594a5fd2e57e8b04))
* **uninstall:** add hook cleanup tests ([6838ac0](https://github.com/kaitranntt/ccs/commit/6838ac0fa1ae0578cf84a451ed628cd8ded31562))
* **uninstall:** update tests for per-profile hook behavior ([ce59eb6](https://github.com/kaitranntt/ccs/commit/ce59eb6269ad65efb27e373b592596355f9dc313))
2026-01-26 03:09:52 +00:00
Kai (Tam Nhu) TranandGitHub 1245cc441a Merge pull request #373 from kaitranntt/dev
feat: per-profile hook injection + uninstall cleanup + setup_completed persistence
2026-01-25 22:08:47 -05:00
github-actions[bot] 3e6d4b0f63 chore(release): 7.27.0-dev.3 [skip ci] 2026-01-26 03:03:38 +00:00
kaitranntt e98a92fded fix: address PR #373 review feedback
- postuninstall.js: add file logging for debugging on error
- profile-hook-injector.ts: use 'wx' flag for atomic marker creation
- profile-hook-injector.ts: include parse error message in debug log
- install-command.ts: use actual counts for consistent semantics
- Windows tests: align Section 7 with per-profile hook architecture
2026-01-25 22:02:25 -05:00
github-actions[bot] e0891fe915 chore(release): 7.27.0-dev.2 [skip ci] 2026-01-26 02:54:03 +00:00
Kai (Tam Nhu) TranandGitHub 2f66f74ff9 Merge pull request #371 from kaitranntt/kai/fix/uninstall-hooks-cleanup
fix: uninstall hooks cleanup + test isolation
2026-01-25 21:53:00 -05:00
kaitranntt cd7a1121d4 fix: address PR review feedback
- ClaudeSymlinkManager.uninstall() now returns count for accurate reporting
- install-command.ts uses return value instead of always incrementing
- claude-dir-installer.ts uses getCcsHome() directly instead of string manipulation
- Add TODO comments to tests explaining --install is a no-op
2026-01-25 21:50:25 -05:00
kaitranntt 6a2c82917d fix(isolation): add getCcsDir/getCcsHome to more files
Fix test isolation in symlink managers and checkers to prevent tests
from touching user's real ~/.ccs/ and ~/.claude/ directories.

Files fixed:
- src/api/services/profile-writer.ts - use getCcsDir()
- src/management/checks/symlink-check.ts - use functions instead of
  module-level constants
- src/utils/claude-dir-installer.ts - use getCcsDir() for CCS paths
- src/utils/claude-symlink-manager.ts - use getCcsHome()/getCcsDir()
2026-01-25 21:42:17 -05:00