Commit Graph
809 Commits
Author SHA1 Message Date
Tam Nhu Tran af6aa2d7b2 fix(types): use type-only import for composite tier config 2026-02-21 01:35:58 +07:00
Tam Nhu Tran 8d2ec86155 refactor(core): centralize claude paths and command parsing 2026-02-21 01:31:16 +07:00
Tam Nhu Tran 5b12ce7f00 fix(api): sanitize preset help text rendering
- strip control characters from dynamic preset output

- render preset help from shared registry data

- include normalized alias hints without hardcoded lines
2026-02-20 23:24:11 +07:00
Tam Nhu Tran 21d6754ec6 refactor(presets): centralize shared provider preset catalog
- add shared preset catalog used by CLI and Dashboard

- enforce alias/id integrity and canonical normalization

- replace duplicated preset definitions in service and UI layers

- allow Vite dev fs access to repo root for shared catalog imports
2026-02-20 23:24:11 +07:00
Tam Nhu Tran e32192177b Merge remote-tracking branch 'origin/dev' into kai/fix/588-nested-session-guard 2026-02-20 23:04:59 +07:00
Tam Nhu Tran 8e57d59479 fix(execution): strip claudecode in remaining claude paths
- sanitize Copilot profile Claude launch environment

- sanitize auth create isolated instance launch environment

- sanitize doctor Claude CLI version check spawn environment

Refs #588
2026-02-20 23:00:59 +07:00
Tam Nhu Tran d25eda8435 fix(spawn): sanitize claudecode in shared claude env builders
- strip CLAUDECODE from cliproxy-built Claude environments

- enforce sanitization in ClaudeAdapter buildEnv

- apply same env hardening in shared spawnClaude helper

Refs #588
2026-02-20 23:00:47 +07:00
Tam Nhu Tran 50412dc679 fix(delegation): strip claudecode in core delegation spawn paths
- add shared CLAUDECODE sanitizer for child env construction

- apply sanitizer in execClaude and headless delegation execution

- sanitize GLMT embedded Claude spawn environment

Refs #588
2026-02-20 23:00:33 +07:00
Tam Nhu Tran 8201204380 fix(quota): address ghcp review follow-ups 2026-02-20 22:53:49 +07:00
Tam Nhu Tran 8d9d4987dc feat(quota): add GitHub Copilot quota checks for ghcp and copilot 2026-02-20 22:32:27 +07:00
Tam Nhu Tran 4303ee48c9 fix(delegation): strip CLAUDECODE env var to bypass nested session guard
Claude Code v2.1.39+ sets CLAUDECODE env var and refuses to launch
if detected, breaking CCS auto-delegation which spawns child Claude
processes. Strip the var from both interactive (execClaude) and
headless (HeadlessExecutor) spawn paths.

Closes #588
2026-02-20 22:22:11 +07:00
Kai (Tam Nhu) TranandGitHub e63292c793 Merge pull request #587 from kaitranntt/kai/feat/583-thinking-ux-dx
feat(thinking): complete thinking UX/DX for all providers
2026-02-19 16:32:05 +07:00
Tam Nhu Tran 954baecfe4 fix(thinking): handle clear no-op and tighten override coverage 2026-02-19 16:26:56 +07:00
Tam Nhu Tran 92e2ec111d fix(thinking): harden codex reasoning controls across cli and dashboard 2026-02-19 14:13:41 +07:00
Tam Nhu Tran 0bf00b23d9 fix(profile): close km legacy kimi compatibility gaps 2026-02-19 13:02:56 +07:00
Tam Nhu Tran c48ed2ea7f feat(thinking): complete thinking UX/DX for all providers
- Fix codex off-mode bug: add disableEffort to CodexReasoningProxy
  so mode=off actually skips reasoning injection
- Add CCS_THINKING env var (priority: flag > env > config)
- Add startup feedback: [i] Thinking: <level> (<source>)
- Add ccs config thinking CLI subcommand with --mode, --override,
  --tier, --provider-override, --clear-override
- Dashboard: add manual override selector when mode=manual
- Dashboard: add provider overrides collapsible section
- Dashboard: update info box with CCS_THINKING env var docs
- Update help-command.ts with CCS_THINKING and config thinking

Closes #583
2026-02-19 12:45:23 +07:00
Tam Nhu Tran cf8070b5f0 fix(profile): handle km compatibility for legacy kimi api users 2026-02-19 12:43:41 +07:00
Kai (Tam Nhu) TranandGitHub 10c15dab3d Merge pull request #585 from kaitranntt/kai/fix/kimi-missing-models
fix(cliproxy): add Kimi model catalog, sync, and pricing to dashboard
2026-02-19 10:49:00 +07:00
Tam Nhu Tran c73a26c51c fix(cliproxy): address review feedback on kimi catalog
- Sync kimi-k2.5 description between backend and UI catalogs
  to 'Latest multimodal model (262K context)' per official naming
- Add kimi-k2 pricing entry to avoid fallback to unknown model rate
- Add supportsModelConfig and getProviderCatalog tests for kimi
2026-02-19 10:41:32 +07:00
Tam Nhu Tran dd38df6b8d fix(cliproxy): add kimi-k2 pricing and kimi catalog tests
Address review feedback from PR #585:
- Add missing kimi-k2 pricing entry ($0.60/$2.50, cache $0.15)
  to avoid fallback to unknown model pricing
- Add kimi provider tests to model-catalog.test.js verifying
  catalog structure, default model, and model IDs
2026-02-19 10:36:42 +07:00
Tam Nhu Tran 3767b95735 fix(cliproxy): add Kimi model catalog, sync, and pricing to dashboard
- Add kimi entry to UI model-catalogs.ts with K2.5, K2 Thinking, K2
  models and preset mappings so dashboard shows available models
- Add kimi to CHANNEL_TO_PROVIDER and SYNCABLE_PROVIDERS in
  catalog-cache.ts so models sync from upstream CLIProxyAPI
- Add kimi/moonshot to provider-editor ownerMap for model filtering
- Update Kimi model pricing to match official Kimi Platform rates:
  kimi-k2.5 ($0.60/$3.00), kimi-k2-thinking ($0.60/$2.50),
  kimi-k2-turbo-preview ($1.15/$8.00)
- Add missing kimi-k2.5 pricing entry

Closes #581
2026-02-19 10:28:40 +07:00
Tam Nhu Tran 476eabe08f fix(cliproxy): warn gemini and agy users about issue 509 2026-02-19 10:12:57 +07:00
Tam Nhu Tran ecc4a3fe58 fix(cliproxy): normalize codex model and provider routing 2026-02-18 21:27:58 +07:00
Tam Nhu Tran a71496cc3d fix(cliproxy): harden provider alias and refresh edge cases
- guard provider alias generation against ambiguous collisions

- add account-scoped Gemini token refresh with strict account checks

- warn and fallback on invalid management remote ports

- align remaining HTTP remote defaults and extend cliproxy tests
2026-02-18 04:18:39 +07:00
Tam Nhu Tran 7e527af777 refactor(cliproxy): resolve remaining review parity and cleanup nits
- export buildProviderMap from provider capabilities and reuse in auth-types

- add provider descriptions to backend capabilities and sync display names

- remove ui CLIPROXY_PORT alias and use CLIPROXY_DEFAULT_PORT directly

- return stable string from getProviderDescription

- extend backend/ui parity tests for display name and description values
2026-02-18 03:35:08 +07:00
Tam Nhu Tran 39593c161b refactor(cliproxy): address review feedback on parity and refresh flow
- make refresh ownership handling exhaustive in provider refresher

- extend backend/ui sync test to provider IDs and device-code providers

- remove DEFAULT_CURSOR_PORT re-export from use-cursor hook

- import cursor default port directly from shared defaults module
2026-02-18 03:24:28 +07:00
Tam Nhu Tran 688f3e3889 refactor(commands): share cliproxy default port for setup and help
- source setup wizard local port default from port-manager

- render help text defaults from shared constant
2026-02-18 03:10:09 +07:00
Tam Nhu Tran 90b8d04d71 refactor(cliproxy): use shared default port in management paths
- replace 8317 literals with CLIPROXY_DEFAULT_PORT constant

- keep http/https fallback behavior unchanged in runtime checks
2026-02-18 03:10:09 +07:00
Tam Nhu Tran bd8daac094 refactor(cliproxy): centralize provider auth capability metadata
- move callback/auth-url names, token type values, and prefixes

- derive auth maps from capabilities instead of hardcoded records

- route refresh delegation through capability ownership metadata
2026-02-18 03:10:09 +07:00
Tam Nhu Tran fae8716900 fix(cursor): fallback when requested model is unavailable
- resolve request model against current available catalog

- choose safe default when configured default id is not present

- add tests and docs for daemon request-model fallback behavior
2026-02-17 20:53:03 +07:00
Tam Nhu Tran 9031e5a085 fix(cliproxy): log unknown codex quota window labels
- detect and de-duplicate unclassified quota window labels

- emit diagnostics in verbose/debug modes for API label drift

- add unit tests for unknown-label extraction behavior
2026-02-17 20:53:03 +07:00
Tam Nhu Tran 53e18d4c8d fix(core): prevent GLMT proxy leaks in child lifecycle
- reuse shared wireChildProcessSignals for GLMT Claude execution

- centralize proxy stop logic on child error and exit paths

- guard global signal cleanup so cleanup failures do not block exit
2026-02-17 20:53:03 +07:00
Tam Nhu Tran 025218a706 feat(targets): support CCS_DROID_ALIASES argv0 mapping
- extend argv[0] target resolution with env-configurable aliases

- normalize alias matching to lowercase with safe-name filtering

- add tests for custom aliases, invalid entries, and case-insensitivity
2026-02-17 20:53:03 +07:00
Tam Nhu Tran 15d6c06dbc fix(targets): snapshot active profiles during droid prune
- copy activeProfiles at call time before lock acquisition

- validate profile names inside locked section

- add tests for invalid names and post-call array mutation
2026-02-17 20:53:03 +07:00
Tam Nhu Tran 812bb5c0a5 fix(targets): run cleanup before adapter launch exits
- wrap adapter early-exit paths with a cleanup-aware exit helper

- invoke cleanup before exiting on child spawn failures

- validate Droid profile names in buildArgs and add unit coverage
2026-02-17 20:53:03 +07:00
Tam Nhu Tran 0fe195cdc3 fix(test): add kimi to provider tests, remove merge conflict marker
- Add kimi to CLIPROXY_PROVIDER_IDS expected array
- Add kimi to device_code providers expected array
- Remove leftover >>>>>>> origin/dev merge conflict marker in cursor-daemon test
- Fix prettier formatting in image-analysis-check.ts
2026-02-17 17:31:27 +07:00
Tam Nhu Tran ddd5b159d2 fix(cliproxy): add kimi to wizard constants and image analysis config
- add kimi entry to PROVIDER_INFO and WIZARD_PROVIDER_ORDER in setup wizard
- add kimi to DEFAULT_IMAGE_ANALYSIS_CONFIG.provider_models
2026-02-17 17:16:52 +07:00
Tam Nhu Tran 672813beba chore: merge dev, resolve cursor-daemon test conflict 2026-02-17 17:05:47 +07:00
Tam Nhu Tran 539afea737 style: format source and test files 2026-02-17 17:03:11 +07:00
Tam Nhu Tran f451f4e421 feat(cliproxy): rename kimi API preset to km, add kimi to UI
- create config/base-km.settings.json for API-key Kimi users
- rename preset id 'kimi' to 'km' in CLI and UI provider presets
- add 'ccs km' to help text API section, keep 'ccs kimi' for OAuth
- add --km delegation flag for API-key mode, --kimi stays for OAuth
- add kimi to UI CLIPROXY_PROVIDERS, assets, colors, names, device code
2026-02-17 17:03:05 +07:00
Tam Nhu Tran 08b2a67913 feat(cliproxy): add Kimi as OAuth CLIProxy provider
- add 'kimi' to CLIProxyProvider union type
- register Kimi capabilities (device_code flow, moonshot alias)
- add OAuth config, auth prefixes, type values, channel maps
- add CLIProxy-delegated token refresh for Kimi
- add Kimi model catalog (k2.5, k2-thinking, k2)
- switch base-kimi.settings.json to CLIProxy mode (127.0.0.1:8317)
- update comments removing kimi from settings-based profile mentions

Closes #574
2026-02-17 17:02:55 +07:00
Tam Nhu Tran 94b03c7f75 refactor(cliproxy): DRY provider lists into single source of truth
- unify CLIPROXY_SUPPORTED_PROVIDERS to import from CLIPROXY_PROVIDER_IDS
- replace 4 inline union types with CLIProxyProvider import
- replace hardcoded provider arrays in migration-manager and proxy-routes
- remove duplicate PROVIDER_DISPLAY_NAMES, use getProviderDisplayName()
- sync test now imports from ui/src/lib/provider-config instead of hardcoded array

Adding a new CLIProxy provider no longer requires updating 14+ hardcoded lists.
2026-02-17 17:02:45 +07:00
Kai (Tam Nhu) TranandGitHub 3c1f49ccd2 Merge pull request #577 from kaitranntt/feat/576-cursor-battle-test-integration
feat(cursor): harden daemon integration and model discovery
2026-02-17 16:49:29 +07:00
Tam Nhu Tran 4798741a99 fix(cursor): resolve review feedback and harden edge cases 2026-02-17 16:33:21 +07:00
Tam Nhu Tran 3da3407f9a fix(targets): harden adapter lifecycle and droid model edge cases 2026-02-17 04:09:48 +07:00
Tam Nhu Tran c639cefa7b feat(cursor): harden daemon integration and model discovery 2026-02-17 04:09:06 +07:00
Tam Nhu Tran 02af8d5737 fix(targets): DRY signal handling, remove redundant guards, harden config manager
- Extract signal forwarding to reusable src/utils/signal-forwarder.ts
- Update shell-executor, claude-adapter, droid-adapter to use shared utility
- Remove 35 lines of redundant duplicate guards in src/ccs.ts
- Harden droid-config-manager with lock constants and race-safe ensureFactoryDir
- Update help-command with --target usage examples
- Update maintainability metrics baseline
2026-02-17 03:38:27 +07:00
Tam Nhu Tran 0431adf306 fix(targets): close all remaining multi-target droid edge cases 2026-02-17 03:22:45 +07:00
Tam Nhu Tran 3191a4ab38 fix(targets): harden edge cases from parallel code review
- droid-config-manager.ts: Profile name validation, backup file perms
  (0o600), symlink detection before write
- droid-detector.ts: Directory check for CCS_DROID_PATH via isFile()
- ccs.ts: Replace hardcoded guards with supportsProfileType() calls,
  add prepareCredentials to default branch
- droid-adapter.ts: errno-aware error messages (EACCES vs ENOENT)
- maintainability-baseline.json: Updated edge case metrics

Hardening fixes address permission handling, symlink detection, and
error classification for improved robustness in edge cases.
2026-02-16 15:32:34 +07:00
Tam Nhu Tran 7d7054e2c0 feat(targets): add multi-target CLI adapter system (Droid support)
Implement target adapter pattern enabling CCS CLI to support multiple backend targets
(Claude, Droid) via pluggable adapters. Core additions:

- TargetAdapter interface for pluggable target implementations
- ClaudeAdapter and DroidAdapter concrete implementations
- Target registry (singleton Map-based storage)
- Target resolver with precedence: --target flag > per-profile config > busybox detection
- Droid config manager with atomic writes and file locking to ~/.factory/settings.json
- Droid binary detector to validate runtime environment
- Adapter dispatch integrated into ccs.ts main execution flow
- ccsd busybox alias for seamless Droid invocation
- --target flag documentation in help
- Session tracking enriched with target metadata
- Dashboard target badge for visual identification

Testing:
- 43 unit tests covering resolver, registry, config manager, and adapters
- Full coverage of target detection logic and edge cases

Documentation:
- Refactored system-architecture.md into modular docs/system-architecture/ subdirectory
- Updated code-standards.md with target adapter guidelines
- Updated codebase-summary.md with architecture overview
- Updated maintainability baseline (33.8% → 35.2%)

This establishes extensible foundation for multi-target support without breaking
existing Claude workflows. Droid adapter is production-ready but defaults to Claude
for backward compatibility.
2026-02-16 10:49:09 +07:00