Kai (Tam Nhu) Tran and GitHub
f9cd61b29a
Merge pull request #159 from kaitranntt/kai/refactor/modularization
...
refactor: modularize CLI and UI codebase architecture
2025-12-20 16:29:18 -05:00
kaitranntt
a9d21c21f2
perf(assets): convert screenshots to WebP, add new feature images
...
- Convert PNG to WebP (85% smaller: ~1.5MB → ~250KB each)
- Add new screenshots: analytics, live-auth-monitor, cliproxyapi, copilot-api, websearch
- Remove old PNG screenshots (analytics-light, api_profiles, cliproxy)
- Update README image references to use .webp format
2025-12-19 20:31:21 -05:00
kaitranntt
0dc2da6e5a
docs(readme): update providers, websearch, and add star history
...
- Add Copilot to built-in providers table with OAuth auth
- Add "Powered by" section crediting CLIProxyAPI and copilot-api
- Update WebSearch from MCP to CLI tool fallback chain (Gemini/OpenCode/Grok)
- Add centered Star History section before footer
- Remove redundant Project Structure (codebase-summary.md is source of truth)
2025-12-19 20:18:21 -05:00
kaitranntt
1ffd169b98
docs: add comprehensive documentation suite for modular architecture
...
Add five documentation files reflecting Phase 5 UI modularization:
- codebase-summary.md: Complete directory structure for CLI and UI
- code-standards.md: 200-line file limit, barrel exports, naming conventions
- system-architecture.md: ASCII architecture diagrams and data flows
- project-roadmap.md: Completed phases 1-5, future work
- project-overview-pdr.md: Product development requirements
2025-12-19 20:17:55 -05:00
kaitranntt
c70ba89b43
refactor(ui): update imports to use new domain directories
...
- update App.tsx imports from layout/
- update page imports from health/, layout/, shared/
- wrap providers/variants in useMemo for stable deps
2025-12-19 19:45:29 -05:00
kaitranntt
e1fd3945fc
refactor(ui): remove old flat component files after reorganization
...
- delete 42 root-level component files
- files moved to domain directories (account/, health/, layout/, etc.)
2025-12-19 19:44:54 -05:00
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
4a5b832a6e
refactor: remove unused deprecated code
...
- remove hasMcpWebSearch(), getMcpConfigPath() from websearch-manager
- delete deprecated web-server/routes.ts (no imports)
2025-12-19 16:02:39 -05:00
kaitranntt
bae323c0d3
refactor(web-server): extract usage module to usage/ directory
...
- create web-server/usage/ with 7 focused modules
- extract: types, disk-cache, data-aggregator, aggregator, handlers, routes
- original files now re-export for backward compatibility
- slim routes.ts (49 lines) delegates to handlers.ts (489 lines)
2025-12-19 16:02:18 -05:00
kaitranntt
c1e5ec70b5
refactor(utils): modularize ui.ts into ui/ directory
...
- split 647-line ui.ts into 10 focused modules (<115 lines each)
- extract: colors, indicators, boxes, tables, text, spinner, tasks
- add init.ts for shared state and types.ts for interfaces
- ui.ts now re-exports from ui/index.ts for backward compat
2025-12-19 16:01:50 -05:00
kaitranntt
6372b3d303
refactor: add barrel exports to api/, glmt/, management/
...
- src/api/index.ts: re-export services module
- src/glmt/index.ts: export all GLMT transformers and pipeline
- src/management/index.ts: export doctor, managers, diagnostics, checks, repair
2025-12-19 16:01:22 -05:00
kaitranntt
99afb3e011
refactor(utils): remove deprecated color and error functions from helpers.ts
...
- remove getColors(), colors, colored(), getTerminalInfo()
- keep error(), expandPath(), levenshteinDistance(), findSimilarStrings()
- reduce file from 155 to 92 lines (-63 lines)
2025-12-19 15:40:04 -05:00
kaitranntt
e1f135a93a
refactor(utils): extract formatRelativeTime to utils/time.ts
...
- create utils/time.ts for centralized time formatting
- remove duplicate from auth/commands/types.ts
- re-export for backward compatibility
- export from utils/index.ts
2025-12-19 15:39:40 -05:00
kaitranntt
18424cba89
refactor(utils): use canonical ValidationResult from types/utils
...
- import ValidationResult from types/utils
- create DelegationValidationResult extending base type
- standardize on 'valid' property naming
2025-12-19 15:39:19 -05:00
kaitranntt
a8f7dad4e3
refactor(websearch): unify CLI status types with ComponentStatus
...
- replace GeminiCliStatus, GrokCliStatus, OpenCodeCliStatus with type aliases
- use ComponentStatus from types/utils as single source of truth
- fix null vs undefined for optional fields
2025-12-19 15:38:57 -05:00
kaitranntt
6c78b63908
refactor(types): add generic types and consolidate ExecutionResult
...
- add OperationResult<T> for success/failure patterns
- add ComponentStatus for CLI tool statuses
- add ValidationResult for validation patterns
- remove duplicate ExecutionResult, re-export from executor/types
2025-12-19 15:38:31 -05:00
kaitranntt
50c427d339
refactor: add barrel exports for commands and utils directories
...
- src/commands/index.ts exports all command handlers
- src/utils/index.ts exports common utilities
2025-12-19 12:36:43 -05:00
kaitranntt
0341f4f86f
refactor(auth): modularize auth-commands into commands/ directory
...
- extract create, list, show, remove, default command handlers
- extract types.ts with CommandContext and parseArgs
- slim auth-commands.ts from 725 to 235 lines (68% reduction)
- add barrel exports at commands/index.ts and auth/index.ts
2025-12-19 12:36:24 -05:00
kaitranntt
c3baaa8251
refactor(delegation): modularize headless-executor into executor/ directory
...
- extract types, stream-parser, result-aggregator
- consolidate ExecutionResult to executor/types.ts (DRY)
- slim headless-executor.ts from 729 to 391 lines (46% reduction)
- add barrel exports at executor/index.ts and delegation/index.ts
2025-12-19 12:35:59 -05:00
kaitranntt
5e4fa200df
refactor(utils): modularize websearch-manager into websearch/ directory
...
- extract gemini-cli, grok-cli, opencode-cli providers
- extract hook-config, hook-env, hook-installer, status, types
- slim websearch-manager.ts from 867 to 103 lines (88% reduction)
- add barrel export at websearch/index.ts
2025-12-19 12:35:37 -05:00
kaitranntt
c1f30ae800
refactor(web-server): modularize health-service into health/ directory
...
- extract system, environment, config, profile, symlink checks
- extract cliproxy, oauth, websearch checks and types
- slim health-service.ts from 901 to 146 lines (84% reduction)
- add barrel export at health/index.ts
2025-12-19 12:35:13 -05:00
kaitranntt
d3c94fe6a2
refactor(cliproxy): modularize binary-manager into binary/ directory
...
- extract types, version-checker, lifecycle, updater, installer
- extract downloader (verifier), extractors (tar, zip), version-cache
- slim binary-manager.ts from 1080 to 137 lines (87% reduction)
- add barrel export at binary/index.ts
2025-12-19 12:34:48 -05:00
kaitranntt
b49b7d17b2
refactor(cliproxy): extract service layer from cliproxy-command
...
- create cliproxy/services/ with 6 modules (1179 → 634 lines)
- variant-service, variant-settings, variant-config-adapter
- proxy-lifecycle-service, binary-service
- separate CLI parsing from business logic
Phase 5: Command Refactor (cliproxy-command.ts)
2025-12-19 11:48:45 -05:00
kaitranntt
ecb6bb448a
refactor(api): extract service layer from api-command
...
- create api/services/ with 5 modules (800 → 426 lines)
- validation-service, profile-types, profile-reader, profile-writer
- separate CLI parsing from business logic
Phase 5: Command Refactor (api-command.ts)
2025-12-19 11:48:33 -05:00
kaitranntt
5c28935d1e
refactor(cliproxy): modularize auth handler and binary
...
- extract 6 auth modules to auth/ directory (932 → 65 lines)
- oauth-handler, oauth-process, token-manager
- environment-detector, auth-types
- extract binary/ with downloader, verifier modules
Phase 3: Large Files Breakdown (auth-handler.ts)
2025-12-19 11:48:21 -05:00
kaitranntt
cd107e354c
refactor(glmt): modularize transformer pipeline
...
- extract 7 pipeline modules (1122 → 206 lines)
- request-transformer, stream-parser, response-builder
- tool-call-handler, content-transformer
- shared types.ts for pipeline interfaces
Phase 3: Large Files Breakdown (glmt-transformer.ts)
2025-12-19 11:48:07 -05:00
kaitranntt
0eb2030dc2
refactor(management): modularize doctor health checks
...
- extract 9 check modules to checks/ directory (1260 → 186 lines)
- add repair/ directory with auto-repair extraction
- system, env, config, profile, cliproxy, oauth, symlink checks
- shared types.ts for check result interfaces
Phase 3: Large Files Breakdown (doctor.ts)
2025-12-19 11:47:55 -05:00
kaitranntt
22dbfd91c5
refactor(errors): centralize error handling infrastructure
...
- add errors/ directory with error types, handler, cleanup registry
- extract claude-spawner.ts from auth modules
- update imports across auth, ccs, web-server
Phase 2 & 4: Error handling consolidation
2025-12-19 11:47:43 -05:00
kaitranntt
9346ff2be9
refactor(web-server): extract usage aggregator service
...
- extract usage-aggregator.ts from usage-routes.ts (883 → 188 lines)
- add services/ directory with barrel export
- separate data aggregation logic from route handlers
Phase 2: Duplicate Extraction
2025-12-19 11:47:30 -05:00
kaitranntt
a12c3d800a
refactor(web-server): modularize routes into dedicated files
...
- extract 14 route modules from monolithic routes.ts (2198 → 49 lines)
- add route-helpers.ts for shared utilities
- add index.ts barrel export for clean imports
- health, profile, config, settings, provider, copilot routes
- variant, proxy, cliproxy-auth, cliproxy-stats, websearch, misc routes
Phase 1: Routes Modularization
2025-12-19 11:47:19 -05:00
semantic-release-bot
ae07ea5d70
chore(release): 6.7.0 [skip ci]
...
## [6.7.0](https://github.com/kaitranntt/ccs/compare/v6.6.1...v6.7.0 ) (2025-12-19)
### Features
* **cliproxy:** auto-apply default preset when adding first account ([4036c42 ](https://github.com/kaitranntt/ccs/commit/4036c42687c0e5124825998350431f17ce617442 ))
* **env:** add debug logging for global env injection ([68eab56 ](https://github.com/kaitranntt/ccs/commit/68eab562ce404ac1933c76520e5597327348bff2 ))
* **recovery:** add lazy initialization for bun/pnpm users ([2d2cd3e ](https://github.com/kaitranntt/ccs/commit/2d2cd3eca21a49af04ca0b1c1d549e62b6ff5cc9 ))
### Bug Fixes
* **ci:** use built-in GITHUB_TOKEN for release comments ([cff38ac ](https://github.com/kaitranntt/ccs/commit/cff38ac53d392317325e2cbf5281956ff59174be ))
* **cliproxy:** include BASE_URL and AUTH_TOKEN when applying presets ([598454c ](https://github.com/kaitranntt/ccs/commit/598454c931267082ba80c4ef426d0ef2c0370f55 ))
* **cliproxy:** prevent port race condition with unified detection and startup lock ([96f17e3 ](https://github.com/kaitranntt/ccs/commit/96f17e3afba93288b041f6c2883753692b4e9ca1 ))
* **cliproxy:** prevent variant names matching reserved provider names ([7ea64bd ](https://github.com/kaitranntt/ccs/commit/7ea64bdb4392d8cd41bc871892466d30c50b58fd ))
* **remote-proxy:** fix TypeError and make port optional with protocol defaults ([03aea4e ](https://github.com/kaitranntt/ccs/commit/03aea4eac233caf00736ceec80b4cc841bce948a )), closes [#142 ](https://github.com/kaitranntt/ccs/issues/142 )
* **update-checker:** resolve dev channel update and duplicate comments ([b6b1817 ](https://github.com/kaitranntt/ccs/commit/b6b18173cc41788328ef1c8831de9527898f06a1 ))
* **web-server:** add comprehensive reserved name validation ([2373100 ](https://github.com/kaitranntt/ccs/commit/2373100c177654910922c6ef0e5ffc7cfe087b26 ))
2025-12-19 16:29:29 +00:00
Kai (Tam Nhu) Tran and GitHub
e46c1d0c1e
Merge pull request #154 from kaitranntt/dev
...
feat: CCS v6.7.0 release
2025-12-19 11:28:30 -05:00
semantic-release-bot
cc725975e9
chore(release): 6.7.0-dev.5 [skip ci]
...
## [6.7.0-dev.5](https://github.com/kaitranntt/ccs/compare/v6.7.0-dev.4...v6.7.0-dev.5 ) (2025-12-19)
### Features
* **cliproxy:** auto-apply default preset when adding first account ([4036c42 ](https://github.com/kaitranntt/ccs/commit/4036c42687c0e5124825998350431f17ce617442 ))
2025-12-19 16:27:37 +00: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
semantic-release-bot
aacff0343d
chore(release): 6.7.0-dev.4 [skip ci]
...
## [6.7.0-dev.4](https://github.com/kaitranntt/ccs/compare/v6.7.0-dev.3...v6.7.0-dev.4 ) (2025-12-19)
### Bug Fixes
* **cliproxy:** prevent port race condition with unified detection and startup lock ([96f17e3 ](https://github.com/kaitranntt/ccs/commit/96f17e3afba93288b041f6c2883753692b4e9ca1 ))
2025-12-19 15:55:15 +00:00
Kai (Tam Nhu) Tran and GitHub
af814aeee8
Merge pull request #153 from kaitranntt/kai/fix/cliproxy-port-race
...
fix(cliproxy): prevent port race condition with unified detection and startup lock
2025-12-19 10:54:11 -05:00
semantic-release-bot
96103f3d93
chore(release): 6.7.0-dev.3 [skip ci]
...
## [6.7.0-dev.3](https://github.com/kaitranntt/ccs/compare/v6.7.0-dev.2...v6.7.0-dev.3 ) (2025-12-19)
### Features
* **recovery:** add lazy initialization for bun/pnpm users ([2d2cd3e ](https://github.com/kaitranntt/ccs/commit/2d2cd3eca21a49af04ca0b1c1d549e62b6ff5cc9 ))
2025-12-19 15:53:05 +00:00
kaitranntt
2d2cd3eca2
feat(recovery): add lazy initialization for bun/pnpm users
...
Bun and pnpm block postinstall scripts by default for security.
This causes ~/.ccs/ directory to not be created on fresh install.
Added lazy initialization in RecoveryManager that mirrors postinstall.js:
- ensureSharedDirectories() - creates ~/.ccs/shared/ subdirs
- ensureGlmSettings() - creates glm.settings.json with defaults
- ensureGlmtSettings() - creates glmt.settings.json with thinking mode
- ensureKimiSettings() - creates kimi.settings.json with k2-thinking-turbo
- ensureShellCompletions() - installs completion files
- Fixed config.json to include glmt profile, removed deprecated default
Now any ccs command will auto-create full ~/.ccs/ structure on first run.
Fixes: bun add -g @kaitranntt/ccs not creating ~/.ccs/
2025-12-19 10:50:52 -05:00
kaitranntt
96f17e3afb
fix(cliproxy): prevent port race condition with unified detection and startup lock
...
Add proxy-detector.ts for unified detection with multiple fallbacks:
- HTTP health check (most reliable)
- Session lock file check
- Port process detection with HTTP retry (handles Windows PID-XXXXX)
Add startup-lock.ts for file-based mutex:
- 10s timeout with 20 retries at 250ms intervals
- Stale lock detection via PID check
- Cross-platform support
Update cliproxy-executor.ts and service-manager.ts to use new modules.
Fixes race conditions when running simultaneous ccs commands.
2025-12-19 10:50:25 -05:00
semantic-release-bot
282ed70dfc
chore(release): 6.7.0-dev.2 [skip ci]
...
## [6.7.0-dev.2](https://github.com/kaitranntt/ccs/compare/v6.7.0-dev.1...v6.7.0-dev.2 ) (2025-12-19)
### Bug Fixes
* **cliproxy:** include BASE_URL and AUTH_TOKEN when applying presets ([598454c ](https://github.com/kaitranntt/ccs/commit/598454c931267082ba80c4ef426d0ef2c0370f55 ))
* **cliproxy:** prevent variant names matching reserved provider names ([7ea64bd ](https://github.com/kaitranntt/ccs/commit/7ea64bdb4392d8cd41bc871892466d30c50b58fd ))
* **web-server:** add comprehensive reserved name validation ([2373100 ](https://github.com/kaitranntt/ccs/commit/2373100c177654910922c6ef0e5ffc7cfe087b26 ))
2025-12-19 14:59:38 +00:00
Kai (Tam Nhu) Tran and GitHub
c827a8d9ac
Merge pull request #151 from kaitranntt/kai/fix/preset-missing-base-config
...
fix(cliproxy): include BASE_URL and AUTH_TOKEN when applying presets
2025-12-19 09:58:38 -05:00