Commit Graph
18 Commits
Author SHA1 Message Date
Tam Nhu Tran 4f6e61739c refactor(config): adopt config-loader-facade across the codebase
Issue #1161. Sweeps 127 files to import from
src/config/config-loader-facade.ts instead of unified-config-loader or
utils/config-manager directly.

WRITE callers (32 files): replaced raw saveUnifiedConfig /
mutateUnifiedConfig / updateUnifiedConfig calls with the facade's
cache-coherent wrappers saveConfig / mutateConfig / updateConfig. This
fixes a latent stale-cache window where direct writes through the
underlying loader bypassed the facade's memoization.

READ callers (95 files): mechanical import-path migration only —
function names unchanged because the facade re-exports them. No
behavior change.

Also updated:
- tests/unit/utils/browser/browser-setup.test.ts (DI interface rename)
- src/management/checks/image-analysis-check.ts (dynamic import rename)
- src/web-server/health-service.ts (dynamic require rename)
- src/ccs.ts (path prefix fix from sweep script)

After sweep: zero raw write callers remain outside src/config/. Direct
imports of config-manager remain only for symbols not in the facade
(getConfigPath, getCcsDirSource, etc). Behavior unchanged; full suite
passes 1824/1824.

Out of scope: switching loadOrCreateUnifiedConfig() callers to
getCachedConfig() — needs per-callsite cache-safety analysis. Tracked
as follow-up.

Refs #1161
2026-05-03 01:42:53 -04:00
Tam Nhu Tran 3b5941c60b feat(cursor): split legacy bridge from cliproxy provider 2026-04-15 17:04:37 -04:00
Tam Nhu Tran 87d93b651b fix(cursor): deprecate legacy bridge and harden gitlab auth 2026-04-15 01:23:15 -04:00
Tam Nhu Tran e1049e38d4 feat(cursor): harden live probe and runtime contracts 2026-04-12 01:51:26 -04:00
Tam Nhu Tran 3dcf879c9f refactor(cli): slim cursor completion imports
- extract cursor subcommand constants into a lightweight module

- remove redundant copilot token concatenation from the command catalog
2026-04-03 00:53:10 -04:00
Tam Nhu Tran 2d67f40175 fix(cursor): route bare cursor through runtime profile 2026-04-01 22:50:58 -04:00
Tam Nhu Tran 27f6a675be fix(cursor): address review feedback and translator edge cases 2026-04-01 22:50:58 -04:00
Tam Nhu Tran d7b907ed9f fix(cursor): make bare cursor command useful and harden tool-result translation 2026-04-01 22:50:58 -04:00
Tam Nhu Tran 4df08f6d99 feat: make cliproxy provider nicknames optional by default 2026-03-23 11:02:08 -04:00
Tam Nhu Tran be9d7cf73e feat(cursor): complete daemon wiring and add dedicated dashboard page 2026-02-14 06:22:28 +07:00
Tam Nhu Tran bfc9361701 fix(cursor): fix router fall-through, add daemon marker, use random test port
- Route all `ccs cursor *` to handleCursorCommand (no profile-switching)
- Add --ccs-daemon marker to spawned process for stable PID validation
- Use random port in lifecycle integration test to prevent CI conflicts
- Remove unnecessary .toFixed(1) on integer tokenAge
2026-02-12 08:37:01 +07:00
Tam Nhu Tran 760a5c3ca4 fix(cursor): harden stopDaemon PID validation, tighten regex, add lifecycle test
- Validate PID belongs to cursor daemon via /proc before signaling
- Tighten detectProvider regex to avoid over-matching o-prefixed models
- Add integration test for daemon start→health→stop lifecycle
- Add void cast on discarded handleHelp() return value
- Update model catalog date comment
2026-02-12 08:28:32 +07:00
Tam Nhu Tran 934238740e fix(cursor): export missing symbols, eliminate subcommand sync risk, improve tests
- Export detectProvider and formatModelName from barrel index
- Export CURSOR_SUBCOMMANDS from cursor-command.ts, import in ccs.ts
- Use getCcsDir() in tests instead of manual path construction
- Add handleCursorCommand routing test for unknown subcommand
2026-02-12 08:21:39 +07:00
Tam Nhu Tran 887efa4069 fix(cursor): show auto-detect error message, add subcommand sync comment 2026-02-12 07:59:39 +07:00
Tam Nhu Tran 88ad13ee7b fix(cursor): kill orphaned daemon on timeout and fix exit codes
MEDIUM fixes:
- Kill orphaned process when health check times out after 30s
- Prevents zombie processes from consuming resources

LOW fixes:
- Return exit code 1 for unknown cursor subcommands (was 0)
- Simplify exit handler dead code branch (else if code !== null → else)
2026-02-12 07:17:03 +07:00
Tam Nhu Tran 9f9db7dcea fix(cursor): save credentials after auto-detect and fix signal hang
- handleAuth() now calls saveCredentials() after successful auto-detect
- Handle code === null (signal kill) in daemon exit handler to prevent
  promise from hanging indefinitely
- Remove unnecessary await on synchronous functions
2026-02-12 04:11:31 +07:00
Tam Nhu Tran 9f0ea25448 fix(cursor): address PR #527 review feedback
- Wire cursor command into main router (ccs.ts) following copilot pattern
- Centralize default port (4242) and model (gpt-4.1) as constants
- Remove duplicate types already in cursor-protobuf-schema from dev
- Handle daemon exit code 0 before health check succeeds
- Export PID helpers and model utils for testability
- Add unit tests for cursor-daemon (PID file ops, isDaemonRunning)
- Add unit tests for cursor-models (detectProvider, formatModelName, defaults)
2026-02-12 04:03:01 +07:00
Tam Nhu Tran aaa31c6427 feat(cursor): add daemon lifecycle, models catalog, and CLI commands
Implements #520 - Cursor IDE daemon, models catalog, module index, and CLI.

Files created:
- src/cursor/cursor-daemon.ts (~230 LOC) - Lifecycle management (start/stop/status)
- src/cursor/cursor-models.ts (~145 LOC) - Model catalog with Anthropic/OpenAI/Google/Cursor models
- src/cursor/index.ts (~30 LOC) - Module barrel exports
- src/commands/cursor-command.ts (~230 LOC) - CLI commands (auth/status/models/start/stop)

Key features:
- Daemon health checks via HTTP /health endpoint
- PID file management in ~/.ccs/cursor/daemon.pid
- Model catalog with fetchModelsFromDaemon() and fallback defaults
- CLI subcommand routing following copilot-command.ts pattern
- ASCII-only output ([OK], [X], [i] markers)

Temporary defaults for config (port: 4242, model: gpt-4.1) until #521 adds
cursor to unified config schema.

Note: Actual daemon server implementation (CursorExecutor integration) deferred
to #522 - this creates the lifecycle structure only.
2026-02-11 18:06:46 +07:00