Commit Graph
960 Commits
Author SHA1 Message Date
semantic-release-bot 8b9da926f2 chore(release): 7.7.1 [skip ci]
## [7.7.1](https://github.com/kaitranntt/ccs/compare/v7.7.0...v7.7.1) (2025-12-26)

### Bug Fixes

* **health:** correct CLIProxy port detection on macOS/Linux ([d1a0ebe](https://github.com/kaitranntt/ccs/commit/d1a0ebee61b8987df85c328d359967e46d1e5226))
* **health:** use prefix matching for Linux process name truncation ([91e7b9f](https://github.com/kaitranntt/ccs/commit/91e7b9f93787e5b2d45bffdaed75e75c151281e4))
2025-12-26 18:09:26 +00:00
Kai (Tam Nhu) TranandGitHub 3a95c0625f Merge pull request #207 from shunkakinoki/fix/cliproxy-port-detection
fix(health): correct CLIProxy port detection on macOS/Linux
2025-12-26 10:08:20 -08:00
kaitranntt 91e7b9f937 fix(health): use prefix matching for Linux process name truncation
Linux kernel truncates process names to 15 chars, causing
'cli-proxy-api-plus' to appear as 'cli-proxy-api-p' in lsof output.
Switch from exact whitelist to prefix matching for robust detection.
2025-12-26 12:57:56 -05:00
Shun KakinokiandClaude Opus 4.5 d1a0ebee61 fix(health): correct CLIProxy port detection on macOS/Linux
Two bugs caused the health check to incorrectly report "Proxy not running":

1. lsof command used mutually exclusive flags (-t and -F)
   - Removed -t flag since -F already provides structured output

2. isCLIProxyProcess whitelist was missing common binary names
   - Added: cliproxyapi, cli-proxy-api-plus (and .exe variants)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:42:23 +09:00
semantic-release-bot 2c977f686a chore(release): 7.7.0 [skip ci]
## [7.7.0](https://github.com/kaitranntt/ccs/compare/v7.6.0...v7.7.0) (2025-12-25)

### Features

* **api:** add Minimax, DeepSeek, Qwen provider presets ([e7066b9](https://github.com/kaitranntt/ccs/commit/e7066b99972129114fb223c6cde40f3127599ae6)), closes [#123](https://github.com/kaitranntt/ccs/issues/123)
* **kiro:** add UI toggle and auth hint for --no-incognito option ([083e674](https://github.com/kaitranntt/ccs/commit/083e67426c382ce534bed4830bedbede94cfdca7))
* **kiro:** improve auth UX with normal browser default and URL display ([df0c947](https://github.com/kaitranntt/ccs/commit/df0c94781e5f198f867723e1b5bccf17d6c4b250))

### Bug Fixes

* **cliproxy:** preserve user API keys during config regeneration ([2b4d21e](https://github.com/kaitranntt/ccs/commit/2b4d21e8ae615c840d76007d733017d375e6036f)), closes [#200](https://github.com/kaitranntt/ccs/issues/200)
* **core:** address all code review issues from PR [#199](https://github.com/kaitranntt/ccs/issues/199) ([f2a4200](https://github.com/kaitranntt/ccs/commit/f2a4200625e13754c7f79738dba0562e8ff27895))
* **kiro:** add --no-incognito option for normal browser auth ([13e4bac](https://github.com/kaitranntt/ccs/commit/13e4baca228313462b3e0e83d0b97594654a989b))
* **profiles:** prevent GLM auth regression from first-time install detection ([cc2d62d](https://github.com/kaitranntt/ccs/commit/cc2d62db38977fd5a0597388c2882e3600e5e179)), closes [#195](https://github.com/kaitranntt/ccs/issues/195)
* **qwen:** inherit stdin for Device Code flows to enable interactive prompts ([c811fdf](https://github.com/kaitranntt/ccs/commit/c811fdfc7914cc3bde3811ea04281055ebb3e273)), closes [#188](https://github.com/kaitranntt/ccs/issues/188)
* **ui:** add gemini-3-flash-preview to model dropdowns ([50653d1](https://github.com/kaitranntt/ccs/commit/50653d1054f89f0eaff24a6d8f471266269383b6)), closes [#194](https://github.com/kaitranntt/ccs/issues/194)
* **ui:** respect initialMode in profile create dialog ([db3662b](https://github.com/kaitranntt/ccs/commit/db3662b47986269ba9c12385021f4aa4bd1633f6))

### Code Refactoring

* **paths:** use expandPath() consistently for cross-platform path handling ([adb6222](https://github.com/kaitranntt/ccs/commit/adb6222bc671c3c4ade1bb019705a985de1947fa))

### Tests

* **auth:** add comprehensive tests for GLM auth persistence fix ([92a79aa](https://github.com/kaitranntt/ccs/commit/92a79aa78ba14aaf2b22f10eaab23f6e04220b17))
2025-12-25 03:18:32 +00:00
Kai (Tam Nhu) TranandGitHub 485da53780 Merge pull request #199 from kaitranntt/dev
feat: v7.6.0 release - provider presets, Kiro auth, CLIProxy key preservation
2025-12-24 22:17:26 -05:00
github-actions[bot] 4d3d3b16f2 chore(release): 7.6.0-dev.6 [skip ci] 2025-12-25 03:13:24 +00:00
kaitranntt 2b4d21e8ae fix(cliproxy): preserve user API keys during config regeneration
When CCS updates trigger CLIProxy config regeneration, user-added API
keys in ~/.ccs/cliproxy/config.yaml were being overwritten with only
the internal CCS key.

Changes:
- Add parseUserApiKeys() to extract user keys from existing config
- Modify regenerateConfig() to preserve user API keys alongside port
- Update generateUnifiedConfigContent() to accept userApiKeys param
- Add comprehensive test suite (14 tests) for key preservation

Fixes #200
2025-12-24 22:12:09 -05:00
github-actions[bot] 7dafed663b chore(release): 7.6.0-dev.5 [skip ci] 2025-12-25 03:00:22 +00:00
Kai (Tam Nhu) TranandGitHub b52e6d69d6 Merge pull request #193 from kaitranntt/kai/fix/kiro-incognito
fix(kiro): add --no-incognito option for normal browser auth
2025-12-24 21:59:19 -05:00
github-actions[bot] e2d8af5d90 chore(release): 7.6.0-dev.4 [skip ci] 2025-12-25 01:20:33 +00:00
kaitranntt f2a4200625 fix(core): address all code review issues from PR #199
Critical fixes:
- CRIT-1: Fix placeholder detection case sensitivity in api-key-validator
- CRIT-2: Add TOCTOU protection via loadMigrationCheckData() for atomic config reads
- CRIT-3: Restore fs.existsSync mock in profile-detector tests

High priority fixes:
- H1-H3: API validator HTTP/HTTPS support, timeout abort, debug log
- H4-H6: OAuth explicit flow type, signal handling, TTY detection
- H7-H8: Profile collision warning, config-first save order
- H9-H11: expandPath consistency, preset sync CLI/UI
2025-12-24 20:18:57 -05:00
github-actions[bot] ff7c3b6c4a chore(release): 7.6.0-dev.3 [skip ci] 2025-12-24 23:49:39 +00:00
Kai (Tam Nhu) TranandGitHub 080ad11804 Merge pull request #197 from kaitranntt/fix/glm-auth-persistence
fix(profiles): prevent GLM auth regression from first-time install detection
2025-12-24 18:48:40 -05:00
Kai (Tam Nhu) TranandGitHub 40aa6de72a Merge pull request #198 from kaitranntt/feat/add-more-models
feat(api): add Minimax, DeepSeek, Qwen provider presets
2025-12-24 18:47:33 -05:00
kaitranntt db3662b479 fix(ui): respect initialMode in profile create dialog
- Fix "Create Custom API Profile" button to open Custom tab instead of OpenRouter
- Improve Custom button visibility with dashed border and better contrast
- Improve Quick Templates styling with better spacing and font weight
- Enhance CompactPresetCard with larger icons and clearer badge styling
2025-12-24 18:43:41 -05:00
kaitranntt 92a79aa78b test(auth): add comprehensive tests for GLM auth persistence fix
Add 26 new unit tests covering:
- isFirstTimeInstall() legacy config detection (8 tests)
- loadSettingsFromFile() path expansion (5 tests)
- ProfileDetector detectProfileType() (4 tests)
- expandPath() cross-platform handling (10 tests)

Test coverage for issue #195:
- Legacy config.json/profiles.json detection
- Tilde expansion to home directory
- Environment variable expansion (${VAR}, $VAR, %VAR%)
- Mixed path separator normalization
- Corrupted config graceful handling

Files:
- tests/unit/commands/setup-command.test.ts
- tests/unit/auth/profile-detector.test.ts
- tests/unit/utils/expand-path.test.ts
2025-12-24 18:33:52 -05:00
kaitranntt e7066b9997 feat(api): add Minimax, DeepSeek, Qwen provider presets
Add three new Anthropic-compatible API providers as presets:
- Minimax: M2.1/M2.1-lightning/M2 models with 1M context
- DeepSeek: V3.2 and R1 reasoning model (128K context)
- Qwen: Alibaba Cloud qwen3-coder-plus (256K context)

Closes #123
2025-12-24 18:32:07 -05:00
kaitranntt adb6222bc6 refactor(paths): use expandPath() consistently for cross-platform path handling
- variant-settings.ts: Use expandPath() in deleteSettingsFile()
- profile-writer.ts: Use expandPath() in removeApiProfileUnified()
- migration-manager.ts: Remove local expandPath(), import from helpers

All path expansion now uses the central expandPath() from utils/helpers.ts
which handles ~, ~\, ${VAR}, $VAR, and %VAR% on all platforms.
2025-12-24 18:19:47 -05:00
kaitranntt cc2d62db38 fix(profiles): prevent GLM auth regression from first-time install detection
- Check legacy config.json/profiles.json in isFirstTimeInstall()
- Use expandPath() for cross-platform path handling in profile-detector
- Add pre-flight API key validation for better error messages
- Enhance 401 error handling with Z.AI refresh guidance

Fixes #195
2025-12-24 18:09:09 -05:00
github-actions[bot] fdc5439c78 chore(release): 7.6.0-dev.2 [skip ci] 2025-12-24 22:53:56 +00:00
Kai (Tam Nhu) TranandGitHub 83b2645202 Merge pull request #196 from kaitranntt/fix/194-gemini-3-flash-preview-dropdown
fix(ui): add gemini-3-flash-preview to model dropdowns
2025-12-24 17:52:53 -05:00
kaitranntt 50653d1054 fix(ui): add gemini-3-flash-preview to model dropdowns
Added gemini-3-flash-preview model to agy and gemini provider catalogs
in the UI. This enables users to select the fast Gemini 3 Flash model
from dropdown menus.

Closes #194
2025-12-24 17:07:56 -05:00
kaitranntt df0c94781e feat(kiro): improve auth UX with normal browser default and URL display
- Change default to noIncognito=true (normal browser) for reliability
- Always print OAuth URL to terminal for VS Code popup detection
- Move incognito toggle from Proxy settings to Kiro provider page
- Add --incognito flag to opt into incognito mode (was --no-incognito)
- Update help text to reflect new defaults
2025-12-24 06:17:17 -05:00
kaitranntt 083e67426c feat(kiro): add UI toggle and auth hint for --no-incognito option
- Add "Kiro: Use normal browser" toggle in config dashboard (Proxy section)
- Add --no-incognito documentation to ccs --help output
- Show hint after successful Kiro auth about saving AWS credentials
2025-12-24 05:26:02 -05:00
kaitranntt 13e4baca22 fix(kiro): add --no-incognito option for normal browser auth
Kiro OAuth always opens in incognito browser mode, which doesn't save
login credentials. Users need to re-enter email each authentication.

Changes:
- Add noIncognito option to OAuthOptions interface
- Add kiro_no_incognito config option to CLIProxyConfig
- Pass --no-incognito flag to CLIProxyAPI binary when enabled
- Support both CLI flag (--no-incognito) and config.yaml setting

Usage:
- CLI: ccs kiro --auth --no-incognito
- Config: cliproxy.kiro_no_incognito: true in config.yaml
2025-12-24 05:02:33 -05:00
github-actions[bot] a1e93eb940 chore(release): 7.6.0-dev.1 [skip ci] 2025-12-24 09:12:01 +00:00
Kai (Tam Nhu) TranandGitHub 1f31d68dd2 Merge pull request #192 from kaitranntt/fix/qwen-login-stdin-forward
fix(qwen): inherit stdin for Device Code flows to enable interactive prompts
2025-12-24 04:11:02 -05:00
kaitranntt c811fdfc79 fix(qwen): inherit stdin for Device Code flows to enable interactive prompts
Device Code flows (Qwen, GHCP) may require interactive terminal input
before generating the device code. For example, Qwen prompts for email.

Previously, all auth processes used piped stdin which blocked user input.
Now Device Code flows use 'inherit' for stdin, allowing users to respond
to prompts directly in the terminal.

Authorization Code flows (Gemini, Codex) still use piped stdin for
programmatic project selection.

Closes #188
2025-12-24 04:04:22 -05:00
semantic-release-bot df90bacf6b chore(release): 7.6.0 [skip ci]
## [7.6.0](https://github.com/kaitranntt/ccs/compare/v7.5.1...v7.6.0) (2025-12-24)

### Features

* **cli:** add config command hints to help and error messages ([e981c39](https://github.com/kaitranntt/ccs/commit/e981c391a26d51de749099ca844915ffc06976e2))
* **setup:** add first-time setup wizard for config initialization ([cec616d](https://github.com/kaitranntt/ccs/commit/cec616d530d9cf61a3a45032465b01e9a4037558)), closes [#142](https://github.com/kaitranntt/ccs/issues/142)

### Bug Fixes

* **cliproxy:** respect enabled:false and use protocol-based port defaults ([a99b6eb](https://github.com/kaitranntt/ccs/commit/a99b6eb93f06c6788bbf13a196bbca908fa06f4c))
* **config:** improve edge case handling for config initialization ([ca78993](https://github.com/kaitranntt/ccs/commit/ca78993e7612143b3193e3cec3f8976be909e2d6))
* **ghcp:** display device code during OAuth device code flow ([46f1699](https://github.com/kaitranntt/ccs/commit/46f1699b1c6f716d06c1eaa3dc6aac94dd5761ec)), closes [#189](https://github.com/kaitranntt/ccs/issues/189)

### Code Refactoring

* **config:** migrate to config.yaml as primary format ([b34469d](https://github.com/kaitranntt/ccs/commit/b34469d75fd2c2b7fd4f4cc4c0cc28885001649b)), closes [#142](https://github.com/kaitranntt/ccs/issues/142)
* **ghcp:** remove unused device code session management ([5de6ccc](https://github.com/kaitranntt/ccs/commit/5de6cccee08aa06d6533181a1db189a595c5e123))
2025-12-24 08:43:29 +00:00
Kai (Tam Nhu) TranandGitHub 948a20d342 Merge pull request #191 from kaitranntt/dev
feat(release): config setup wizard, device code display, and proxy bug fixes
2025-12-24 03:42:21 -05:00
github-actions[bot] 91a079ad20 chore(release): 7.5.1-dev.4 [skip ci] 2025-12-24 08:38:07 +00:00
kaitranntt a99b6eb93f fix(cliproxy): respect enabled:false and use protocol-based port defaults
- Fix port default logic: HTTP→8317, HTTPS→443 (was always 8317)
- Fix enabled:false being ignored in proxy config resolution
- Update stale comments referencing HTTP:80 to HTTP:8317
- Add 9 unit tests for edge cases (enabled handling, port defaults)
2025-12-24 03:36:48 -05:00
github-actions[bot] 659761f019 chore(release): 7.5.1-dev.3 [skip ci] 2025-12-24 08:24:13 +00:00
Kai (Tam Nhu) TranandGitHub 1a8ba4e40c Merge pull request #190 from kaitranntt/fix/ghcp-auth-code-display
fix(ghcp): display device code during OAuth device code flow
2025-12-24 03:23:11 -05:00
kaitranntt 5de6cccee0 refactor(ghcp): remove unused device code session management
- Remove unused functions: registerDeviceCode, completeDeviceCode,
  failDeviceCode, getActiveDeviceCode, hasActiveDeviceCode,
  getAllActiveDeviceCodes, ActiveSession interface, activeSessions Map
- Reduce device-code-handler.ts from 168 to 33 lines (YAGNI)
- Add ARIA labels to copy button for accessibility
- Fix timer to stop at 0 seconds instead of continuing negative
- Add "(Code expired)" visual indicator with destructive styling
- Change void sessionId to data-session-id attribute for debugging

Code review findings applied. Gemini OAuth unaffected (uses separate
project-selection-handler.ts with Authorization Code Flow).
2025-12-24 03:15:57 -05:00
kaitranntt 46f1699b1c fix(ghcp): display device code during OAuth device code flow
When authenticating with GitHub Copilot using device code flow,
the user code was not being displayed. This fix:

- Parses device codes from CLIProxy output in oauth-process.ts
- Displays code prominently in CLI terminal with box formatting
- Broadcasts device code events via WebSocket for UI display
- Creates DeviceCodeDialog component for web UI (ccs config)
- Follows same pattern as Gemini project selection dialog

Closes #189
2025-12-24 03:02:36 -05:00
github-actions[bot] 8d1f1a6a94 chore(release): 7.5.1-dev.2 [skip ci] 2025-12-24 04:03:58 +00:00
Kai (Tam Nhu) TranandGitHub 4867df26fc Merge pull request #187 from kaitranntt/fix/config-init-defaults
feat(setup): add first-time setup wizard and migrate to config.yaml
2025-12-23 23:02:57 -05:00
kaitranntt ca78993e76 fix(config): improve edge case handling for config initialization
- setup-command.ts: Add Ctrl+C handling (UserCancelledError), port
  validation (1-65535), protocol stripping from host, try-catch with
  user-friendly error messages
- postinstall.js: Add ~/.ccs file check (not directory), wrap js-yaml
  require in try-catch with JSON fallback, validate config.json before
  migration, warn when both config files exist
- recovery-manager.ts: Verify config is loadable (not just exists),
  add nested error handling for fallback write
- ccs.ts: Make first-time install hint independent of recovery status
  (shows even when user manually created empty config.yaml)

All edge cases identified by code review addressed.
2025-12-23 22:34:32 -05:00
kaitranntt b34469d75f refactor(config): migrate to config.yaml as primary format
- Update postinstall.js to create config.yaml instead of config.json
- Update recovery-manager to create config.yaml as primary config
- Fix isFirstTimeInstall() to check for meaningful config content
  (profiles, accounts, variants, oauth_accounts, remote proxy)
- Update validation to accept config.yaml OR config.json
- Preserve backward compatibility: legacy config.json is migrated
  to config.yaml on first run via autoMigrate()
- Update postinstall tests to verify config.yaml creation

Fixes #142 - remote CLIProxyAPI configuration
2025-12-23 21:54:55 -05:00
kaitranntt cec616d530 feat(setup): add first-time setup wizard for config initialization
Addresses Issue #142 - remote CLIProxyAPI configuration for Docker/server deployments.

Changes:
- Add `ccs setup` command with interactive wizard
- Support local vs remote CLIProxy mode selection
- Guide users through remote proxy config (host, port, auth token)
- Auto-detect first-time install and suggest setup wizard
- Update help command to include setup

Scenarios covered:
1. New users - wizard guides through local/remote/skip choice
2. Remote proxy users - configure host/port/protocol/auth_token
3. Local users - default auto-start behavior
4. Skip CLIProxy - only API profiles or Claude accounts
2025-12-23 21:28:38 -05:00
github-actions[bot] 9d8268b0f6 chore(release): 7.5.1-dev.1 [skip ci] 2025-12-23 05:56:23 +00:00
kaitranntt e981c391a2 feat(cli): add config command hints to help and error messages
Enhance discoverability of the 'ccs config' command by adding hints to
the help menu, post-update/doctor messages, and relevant error states.
2025-12-23 00:55:17 -05:00
semantic-release-bot f62b48972d chore(release): 7.5.1 [skip ci]
## [7.5.1](https://github.com/kaitranntt/ccs/compare/v7.5.0...v7.5.1) (2025-12-23)

### Bug Fixes

* **ui:** use UI color system for consistent CLI indicators ([91cd9ff](https://github.com/kaitranntt/ccs/commit/91cd9ffc16e46737d190b3858340e7c745021ef4))

### Code Refactoring

* **cliproxy:** enhance binary downloader with robust error handling ([c2dd026](https://github.com/kaitranntt/ccs/commit/c2dd0261b7c2a8e4b9bd11b04df16ed3ba6e93be))
2025-12-23 00:46:30 +00:00
Kai (Tam Nhu) TranandGitHub d552ec0251 Merge pull request #182 from kaitranntt/dev
fix(ui): consistent CLI indicators and enhanced binary downloader
2025-12-22 19:45:21 -05:00
github-actions[bot] 4ec931801c chore(release): 7.5.0-dev.2 [skip ci] 2025-12-23 00:42:11 +00:00
kaitranntt 91cd9ffc16 fix(ui): use UI color system for consistent CLI indicators 2025-12-22 19:41:05 -05:00
github-actions[bot] dbc128948e chore(release): 7.5.0-dev.1 [skip ci] 2025-12-22 23:23:39 +00:00
kaitranntt c2dd0261b7 refactor(cliproxy): enhance binary downloader with robust error handling
- Add categorized error detection for socket, timeout, HTTP, and redirect errors
- Implement smarter exponential backoff (longer delays for socket errors)
- Increase max retries from 3 to 5 with dynamic timeout adjustment
- Add resource cleanup (disable connection pooling for clean process exit)
- Add user-friendly error messages for each error type
- Refactor fetchText/fetchJson with retry logic and proper error handling
- Set 120s timeout for large binary downloads, 15-30s for text/JSON
- Prevent double-resolution and race conditions in Promise handlers
2025-12-22 18:22:32 -05:00