Commit Graph
1111 Commits
Author SHA1 Message Date
kaitranntt a69b2e9d10 feat(cliproxy): add version management UI with install/restart controls
Implements comprehensive version management for CLIProxyAPI Plus:

Backend APIs:
- GET /versions: fetch available versions from GitHub releases
- POST /install: install specific version with force flag for unstable
- POST /restart: restart proxy without version change

Frontend:
- 4-button layout: Restart, Update/Downgrade, Stop, Settings gear
- Collapsible version picker with dropdown + manual input
- Confirmation dialog for unstable versions (>6.6.80)
- Progressive disclosure (version picker hidden by default)

Ref: plans/260105-1250-cliproxy-version-management/
2026-01-05 13:12:46 -05:00
kaitranntt 8a56a43989 feat(ui): add stability warning to ProxyStatusWidget
- Show amber warning indicator when installed version is unstable (v81+)
- Version display now shows "(unstable)" suffix with amber styling
- "Downgrade" button replaces "Update" when version is unstable
- Tooltip explains restart will downgrade to stable version
2026-01-05 12:46:35 -05:00
kaitranntt c5621dab51 feat(cliproxy): add dashboard UI parity for version stability
Add version stability warnings to Dashboard API and UI:
- Extend /api/cliproxy/update-check with isStable, maxStableVersion, stabilityMessage
- Health check shows warning status for v81+ installations
- UI header displays version badge with amber warning for unstable

Closes: relates to #269
2026-01-05 12:10:32 -05:00
kaitranntt 212aef81bc fix(cliproxy): add edge case handling for version capping
- Add isAboveMaxStable() helper for version stability checks
- Add null/empty guard in clampToMaxStable() function
- Warn users on unstable v81+ without forcing downgrade
- Add context note showing latest version when it's unstable
- Clamp fallback version on GitHub API failure
2026-01-05 11:50:06 -05:00
kaitranntt 869ab3eecd fix(cliproxy): cap auto-update to v80 due to v81+ context bugs
CLIProxyAPIPlus v81+ has context cancellation bugs causing:
- Intermittent 500 errors
- "context canceled" errors during streaming
- Broken token refresh handling

Root cause: v81 commit 7a77b23 changed refreshToken to use
detached context.Background() causing race conditions.

Solution: Add CLIPROXY_MAX_STABLE_VERSION constant (6.6.80-0)
and clamp auto-update to this version until upstream fixes.

Closes #269
2026-01-05 11:41:52 -05:00
github-actions[bot] 3a40a0d015 chore(release): 7.13.1-dev.1 [skip ci] 2026-01-05 07:47:13 +00:00
Kai (Tam Nhu) TranandGitHub 6857f8e012 Merge pull request #261 from jellydn/feat/dev-symlink-setup
feat(dev): add symlink setup for testing dev version
2026-01-04 23:46:13 -08:00
semantic-release-botandkaitranntt 981cef8211 feat(dev): add symlink setup for testing dev version
Add dev:symlink and dev:unlink scripts to enable seamless testing of
development changes using the global 'ccs' command without needing to
pack/install globally each time.

- scripts/dev-symlink.sh: New script that safely creates symlinks from
  global ccs to dev dist/ccs.js with backup/restore functionality
- package.json: Added dev:symlink and dev:unlink npm scripts
- CONTRIBUTING.md: Updated development setup documentation with
  symlink workflow option

This improves developer experience by allowing immediate testing of
changes with 'ccs <command>' instead of './dist/ccs.js <command>'.
2026-01-05 02:45:01 -05:00
semantic-release-bot 42e6ed72da chore(release): 7.13.1 [skip ci]
## [7.13.1](https://github.com/kaitranntt/ccs/compare/v7.13.0...v7.13.1) (2026-01-05)

### Bug Fixes

* **cliproxy:** add management_key support for remote proxy auth separation ([0e58d0e](https://github.com/kaitranntt/ccs/commit/0e58d0e8b7fd07004990e99fbdc6a080380c0304))
* **cliproxy:** add missing kiro/ghcp provider mappings in remote-auth-fetcher ([dea0e87](https://github.com/kaitranntt/ccs/commit/dea0e872bd529b2c6f825dc1d9e901d0896b7f41))
* **cliproxy:** extract unique accountId from token filename for Kiro/GHCP ([7bb7ccc](https://github.com/kaitranntt/ccs/commit/7bb7ccc27fe0d9885c4dd7f23de664e2c8b4866f)), closes [#258](https://github.com/kaitranntt/ccs/issues/258)
* **cliproxy:** proactive token refresh to prevent UND_ERR_SOCKET ([a6a653f](https://github.com/kaitranntt/ccs/commit/a6a653f14580888bcdccbf6b83b90d41b6b52136)), closes [#256](https://github.com/kaitranntt/ccs/issues/256)
* **validation:** add Windows reserved name validation and version format edge cases ([ae1847d](https://github.com/kaitranntt/ccs/commit/ae1847d9011c8bff9caff206cf1d7082c61faf40))
2026-01-05 05:09:23 +00:00
Kai (Tam Nhu) TranandGitHub 3c01d04749 Merge pull request #263 from kaitranntt/dev
feat: cliproxy improvements and validation enhancements
2026-01-04 21:08:21 -08:00
github-actions[bot] 001a1890ca chore(release): 7.13.0-dev.4 [skip ci] 2026-01-05 05:02:06 +00:00
kaitranntt ae1847d901 fix(validation): add Windows reserved name validation and version format edge cases
- Fixed version regex to accept -N suffix (e.g., 6.6.80-0)
- Added .trim() to version input for whitespace handling
- Added Windows reserved device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9) validation
- Updated binary-service, variant-service, and validation-service with checks
2026-01-05 00:00:58 -05:00
github-actions[bot] 3cdf42c2be chore(release): 7.13.0-dev.3 [skip ci] 2026-01-03 17:50:24 +00:00
Kai (Tam Nhu) TranandGitHub e95c2cdf4c Merge pull request #260 from kaitranntt/fix/api-socket-connection
fix(cliproxy): proactive token refresh to prevent UND_ERR_SOCKET
2026-01-03 09:49:25 -08:00
kaitranntt a6a653f145 fix(cliproxy): proactive token refresh to prevent UND_ERR_SOCKET
When Gemini OAuth tokens expire, CLIProxyAPI attempts synchronous
refresh during API calls. If this fails or times out, the socket
connection closes abruptly causing Claude CLI's undici to report
UND_ERR_SOCKET errors.

This fix adds proactive token validation before spawning Claude CLI:
- New gemini-token-refresh.ts module handles Gemini OAuth refresh
- ensureTokenValid() in token-manager.ts checks expiry with 5min lead
- cliproxy-executor.ts calls ensureTokenValid() after auth check

The token is now refreshed BEFORE Claude CLI connects, eliminating
the race condition that caused socket errors.

Fixes #256
2026-01-03 12:47:50 -05:00
github-actions[bot] cd1c4081b2 chore(release): 7.13.0-dev.2 [skip ci] 2026-01-03 16:54:16 +00:00
Kai (Tam Nhu) TranandGitHub 0a09959979 Merge pull request #259 from kaitranntt/fix/kiro-ghcp-account-id
fix(cliproxy): extract unique accountId from token filename for Kiro/GHCP
2026-01-03 08:53:16 -08:00
kaitranntt 7bb7ccc27f fix(cliproxy): extract unique accountId from token filename for Kiro/GHCP
When OAuth accounts have empty email fields (Kiro/GHCP), the accountId
was defaulting to 'default', causing multiple accounts to overwrite
each other. Now extracts unique ID from filename pattern:
- kiro-github-<PROFILE_ID>.json → github-<PROFILE_ID>
- ghcp-amazon-<PROFILE_ID>.json → amazon-<PROFILE_ID>

Fixes #258
2026-01-03 11:51:26 -05:00
github-actions[bot] 9fdf437ace chore(release): 7.13.0-dev.1 [skip ci] 2026-01-03 16:30:21 +00:00
Kai (Tam Nhu) TranandGitHub dbb3ea51cf Merge pull request #257 from kaitranntt/fix/cliproxy-dashboard-providers
fix(cliproxy): add management_key support for remote proxy auth separation
2026-01-03 08:29:22 -08:00
kaitranntt 0e58d0e8b7 fix(cliproxy): add management_key support for remote proxy auth separation
- Add management_key field to CliproxyServerConfig for separate management API auth
- Update proxy-target-resolver with buildManagementHeaders() for /v0/management/* endpoints
- Update stats-fetcher and remote-auth-fetcher to use management headers
- Add management_key input field to dashboard remote proxy settings
- Disable quota UI in remote mode (tokens on remote server)
- Fix preset application to use dynamic API key from config instead of hardcoded placeholder
2026-01-02 22:31:28 -05:00
kaitranntt dea0e872bd fix(cliproxy): add missing kiro/ghcp provider mappings in remote-auth-fetcher
Remote mode was silently skipping kiro and ghcp providers because
PROVIDER_MAP and PROVIDER_DISPLAY_NAMES were incomplete. Added:
- kiro, codewhisperer -> kiro
- ghcp, github-copilot, copilot -> ghcp

Fixes dashboard showing '0 providers' when using Remote Proxy.
2026-01-02 20:42:14 -05:00
semantic-release-bot b549bb433c chore(release): 7.13.0 [skip ci]
## [7.13.0](https://github.com/kaitranntt/ccs/compare/v7.12.2...v7.13.0) (2026-01-03)

### Features

* **minimax:** Add full MiniMax M2.1 support ([bd5c9a0](https://github.com/kaitranntt/ccs/commit/bd5c9a0033e1c4df8aef90db194a768f55e9eab8))
* **minimax:** Add mm profile and migration support ([267599d](https://github.com/kaitranntt/ccs/commit/267599d09d691cb38b7a9f3b201ce1e3761bfe08))

### Bug Fixes

* **accounts:** integrate CLIProxy OAuth accounts into API endpoint ([eebcb7b](https://github.com/kaitranntt/ccs/commit/eebcb7b10351ce9c939ffcc769d354bc463a8ee1))
* **migrate:** Add rename-profile flag handling ([4dace51](https://github.com/kaitranntt/ccs/commit/4dace513eab3ffc28cf67fc1db652f5908403973))
* **minimax:** Add MiniMax placeholder to DEFAULT_PLACEHOLDERS ([46e0995](https://github.com/kaitranntt/ccs/commit/46e09950e8f9f612ce819e6191e63279b2fb3b1f))
* **minimax:** prevent double-resolve race condition and align placeholder ([a59ad0e](https://github.com/kaitranntt/ccs/commit/a59ad0e8c63b4159a35558dcae03ed4a7ca42c6f))
* **minimax:** restore migrate-command, remove broken migration file, fix validator typo ([c48f798](https://github.com/kaitranntt/ccs/commit/c48f798f3e375a25cf012f7b6f9c1853c8f99836))

### Documentation

* **minimax:** Update review_pr.md with fix status ([5d34bd6](https://github.com/kaitranntt/ccs/commit/5d34bd6ec2cd6a1a43fa3c62af820edb29442325))

### Code Refactoring

* **api-key-validator:** extract shared validation logic, remove unnecessary comments ([a00cf36](https://github.com/kaitranntt/ccs/commit/a00cf3691ef551f24dcac149c4473d9fdcf28043))
* **minimax:** Rename to 'mm' for brevity ([2b549f5](https://github.com/kaitranntt/ccs/commit/2b549f5b3dddbd17f40ef987badf4715d89297c7))
2026-01-03 01:09:49 +00:00
Kai (Tam Nhu) TranandGitHub 95d8b28691 Merge pull request #255 from kaitranntt/dev
feat(minimax): add MiniMax M2.1 support and fix accounts display
2026-01-02 17:08:47 -08:00
github-actions[bot] fb0cd59bee chore(release): 7.12.2-dev.2 [skip ci] 2026-01-03 01:07:50 +00:00
Kai (Tam Nhu) TranandGitHub 32fe4553e3 Merge pull request #250 from jellydn/feat/minimax-full-support
feat(minimax): Add full MiniMax M2.1 support
2026-01-02 17:06:48 -08:00
kaitranntt a59ad0e8c6 fix(minimax): prevent double-resolve race condition and align placeholder
- Add resolved flag + safeResolve() wrapper to prevent timeout/response race
- Align apiKeyPlaceholder to YOUR_MINIMAX_API_KEY_HERE across presets
2026-01-02 20:06:17 -05:00
github-actions[bot] b1b7f8ff93 chore(release): 7.12.2-dev.1 [skip ci] 2026-01-03 00:55:54 +00:00
Kai (Tam Nhu) TranandGitHub cd4ef52808 Merge pull request #254 from kaitranntt/fix/proxy-accounts-not-shown
fix(accounts): integrate CLIProxy OAuth accounts into API endpoint
2026-01-02 16:54:56 -08:00
kaitranntt eebcb7b103 fix(accounts): integrate CLIProxy OAuth accounts into API endpoint
- Add CLIProxy accounts to GET /api/accounts (was only showing legacy/unified)
- Use unique ID for key to prevent collision between accounts with same nickname
- Skip accounts with missing identifier
- Route set-default to CLIProxy account manager for provider:id format
- Route delete to CLIProxy account manager for provider:id format
2026-01-02 19:51:50 -05:00
Huynh Duc DungandClaude a00cf3691e refactor(api-key-validator): extract shared validation logic, remove unnecessary comments
- Extract common validation logic into validateProviderKey() function
- Convert validateGlmKey() and validateMiniMaxKey() to thin wrappers
- Remove 15+ unnecessary inline comments explaining obvious code
- Remove verbose JSDoc that duplicates function signatures
- Reduce file from 236 to 148 lines (37% reduction)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-03 07:54:32 +08:00
Huynh Duc Dung c48f798f3e fix(minimax): restore migrate-command, remove broken migration file, fix validator typo
- Restore src/commands/migrate-command.ts to dev branch state (was truncated)
- Remove src/config/rename-minimax-profile.ts (circular export causing build break)
- Fix mm.settings.json path typo in api-key-validator.ts

Build now passes: bun run typecheck && bun run lint:fix
2026-01-03 07:46:44 +08:00
Huynh Duc Dung 4dace513ea fix(migrate): Add rename-profile flag handling
- Add renameMinimaxProfile import from rename-minimax-profile.ts
- Handle --rename-profile <from> <to> flag in handleMigrateCommand
- Update help text with rename-profile example
- Fix @ts-ignore comment to suppress unused warning
2026-01-02 21:19:22 +08:00
Huynh Duc Dung 267599d09d feat(minimax): Add mm profile and migration support
- Rename profile from minimax to mm for brevity
- Add renameMinimaxProfile() migration function
- Add --rename-profile flag to migrate command
- Update help text with rename-profile example
2026-01-02 21:17:26 +08:00
Huynh Duc Dung 2b549f5b3d refactor(minimax): Rename to 'mm' for brevity
- Rename profile ID: minimax -> mm
- Rename settings file: base-minimax.settings.json -> base-mm.settings.json
- Update all code references
- Remove review_pr.md documentation
- Shorter CLI command: ccs mm instead of ccs minimax

Rationale:
- 'mm' is more concise (2 chars vs 7 chars)
- Matches 'glm', 'kimi' short naming pattern
- Improves UX for frequent switching
2026-01-02 20:38:52 +08:00
Huynh Duc Dung 5d34bd6ec2 docs(minimax): Update review_pr.md with fix status
- Mark Issue 1 as FIXED (model name casing)
- Mark Issue 2 as FIXED (placeholder added)
- Update review summary with completion status
- Ready for merge
2026-01-02 20:32:29 +08:00
Huynh Duc Dung 46e09950e8 fix(minimax): Add MiniMax placeholder to DEFAULT_PLACEHOLDERS
- Add 'YOUR_MINIMAX_API_KEY_HERE' for consistency
- Ensures placeholder detection works correctly
- Aligns with other provider patterns (GLM, Kimi)
2026-01-02 20:31:27 +08:00
Huynh Duc Dung bd5c9a0033 feat(minimax): Add full MiniMax M2.1 support
- Add MiniMax settings template (config/base-minimax.settings.json)
- Add MiniMax pricing (3 models: M2.1, M2.1-lightning, M2)
- Add validateMiniMaxKey() pre-flight validator
- Integrate MiniMax validation in main CLI flow
- Fix model name casing: M2.1-lightning (lowercase l)

Implementation follows GLM pattern:
- Anthropic-compatible API (no proxy needed)
- Pre-flight validation with health check
- Fail-open on network errors
- Actionable error messages
2026-01-02 20:27:52 +08:00
semantic-release-bot c05f27fdb3 chore(release): 7.12.2 [skip ci]
## [7.12.2](https://github.com/kaitranntt/ccs/compare/v7.12.1...v7.12.2) (2026-01-01)

### Bug Fixes

* **cliproxy:** add kiro/ghcp provider mappings to discoverExistingAccounts ([4386e91](https://github.com/kaitranntt/ccs/commit/4386e9122d92c7c32d8f11c4216631a473b5c5dd)), closes [#242](https://github.com/kaitranntt/ccs/issues/242)
* **ui:** show min Claude quota instead of avg all models ([a011908](https://github.com/kaitranntt/ccs/commit/a011908b3cf439b4a6e0a88ebaef03b8e527fb68))

### Tests

* **cliproxy:** add unit tests for discoverExistingAccounts ([43f1a98](https://github.com/kaitranntt/ccs/commit/43f1a9890e20387fdd8f059a778e345e9c3eacc2))
2026-01-01 20:08:11 +00:00
Kai (Tam Nhu) TranandGitHub 9c6dce10d1 Merge pull request #246 from kaitranntt/dev
feat(release): kiro/ghcp provider discovery + claude-first quota bar
2026-01-01 12:07:12 -08:00
github-actions[bot] daa34472b6 chore(release): 7.12.1-dev.2 [skip ci] 2026-01-01 19:59:37 +00:00
Kai (Tam Nhu) TranandGitHub 530b70c2a3 Merge pull request #245 from kaitranntt/fix/quota-bar-claude-priority
fix(ui): show min Claude quota instead of avg all models
2026-01-01 11:58:38 -08:00
kaitranntt a011908b3c fix(ui): show min Claude quota instead of avg all models
Main quota bar now displays minimum of Claude model quotas rather
than averaging all models. Accurately reflects primary constraint.

Changes:
- Add getMinClaudeQuota() utility in utils.ts (DRY)
- Apply fix to both account-card.tsx and account-item.tsx
- Add comprehensive test suite (23 tests covering edge cases)

Before: 99% (avg of Claude 95% + Gemini 100%...)
After: 95% (min of Claude models)
2026-01-01 14:44:30 -05:00
github-actions[bot] 25d213ad64 chore(release): 7.12.1-dev.1 [skip ci] 2026-01-01 19:40:59 +00:00
Kai (Tam Nhu) TranandGitHub 05d2934589 Merge pull request #244 from kaitranntt/fix/discover-accounts-kiro-ghcp
fix(cliproxy): add kiro/ghcp provider mappings to discoverExistingAccounts
2026-01-01 11:40:00 -08:00
kaitranntt 43f1a9890e test(cliproxy): add unit tests for discoverExistingAccounts
- Test kiro/ghcp provider type mapping
- Test email extraction from filename fallback
- Test multiple accounts per provider
- Test edge cases (invalid JSON, missing type, unknown provider)
2026-01-01 13:34:25 -05:00
kaitranntt 4386e9122d fix(cliproxy): add kiro/ghcp provider mappings to discoverExistingAccounts
- Replace hardcoded typeToProvider with dynamic lookup from PROVIDER_TYPE_VALUES
- Add email extraction from filename as fallback for empty data.email
- Fixes issue where Kiro/GHCP accounts were skipped during discovery

Closes #242
2026-01-01 13:20:59 -05:00
semantic-release-bot 0f33b7e34d chore(release): 7.12.1 [skip ci]
## [7.12.1](https://github.com/kaitranntt/ccs/compare/v7.12.0...v7.12.1) (2026-01-01)

### Bug Fixes

* **cliproxy:** add comprehensive port validation across proxy system ([e0a1f8f](https://github.com/kaitranntt/ccs/commit/e0a1f8f312c1eb7621b3ea2af2edb4df44a51f64))
* **cliproxy:** filter undefined config values to preserve defaults ([4c35e8a](https://github.com/kaitranntt/ccs/commit/4c35e8a39ed03ab026a1dff230e06f5d9449fbef))
2026-01-01 07:03:28 +00:00
Kai (Tam Nhu) TranandGitHub 50f40bb882 Merge pull request #241 from kaitranntt/dev
fix(cliproxy): resolve undefined port bug in CLIProxy executor
2025-12-31 23:02:26 -08:00
github-actions[bot] 00e8dd417e chore(release): 7.12.0-dev.1 [skip ci] 2026-01-01 07:01:43 +00:00