Commit Graph
84 Commits
Author SHA1 Message Date
kaitranntt 3bd3e379fe test(cliproxy): add unit tests for thinking validator
- test budget bounds and constants

- test off/auto/level values handling

- test budget-type and level-type models

- test edge cases and unknown models

Refs #307
2026-01-08 15:20:37 -05:00
kaitranntt 87cfcc5b3c fix(codex-proxy): security hardening and edge case fixes
- Fix path traversal in trace() via safe dir validation
- Add RFC 7230 hop-by-hop header filtering
- Fix isRecord() to exclude arrays
- Add req.destroy() on oversized body rejection
- Add missing ANTHROPIC_BASE_URL warning for Codex
- Use cwd() fallback when HOME undefined
- Add 4 edge case unit tests
2026-01-08 09:15:42 -05:00
oscarlehuu 204eea00ce feat(codex): inject OpenAI reasoning.effort per tier 2026-01-08 16:02:02 +10:30
kaitranntt d96c67ba81 fix(cliproxy): use nickname as accountId for kiro/ghcp providers
Kiro/GHCP OAuth tokens have empty email field, causing all accounts to
use accountId='default' and overwrite each other. This fix:

- Add PROVIDERS_WITHOUT_EMAIL constant for kiro/ghcp identification
- Require nickname for kiro/ghcp during registration (CLI + web UI)
- Use nickname as accountId instead of email for these providers
- Enforce nickname uniqueness to prevent collisions
- Update discoverExistingAccounts() to generate unique IDs (kiro-1, etc.)

Closes #258, #267
2026-01-06 12:16:22 -05:00
kaitranntt 1067afbea7 fix(shared-manager): normalize plugin registry paths to canonical ~/.claude/
Replaces instance-specific paths (/.ccs/instances/<name>/) with
canonical /.claude/ paths in installed_plugins.json after linking.

Fixes #276
2026-01-05 20:48:49 -05: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 e0a1f8f312 fix(cliproxy): add comprehensive port validation across proxy system
- Export validatePort() from config-generator with full edge case handling
- Add YAML port validation in proxy-config-resolver before use
- Add final port validation in cliproxy-executor after config merge
- Add default port parameter and validation to proxy-detector
- Add 38 new tests covering all port validation edge cases

Fixes undefined port bug when upgrading from 7.11.1 to 7.12.0
2026-01-01 02:00:30 -05:00
Kai (Tam Nhu) TranGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>Shun KakinokiClaude Opus 4.5
b3ef76a07b feat(release): CLI flag passthrough, proxy fixes, and UI improvements (#239)
* fix(cliproxy): pass variant port to executor for isolation

Variants configured with dedicated ports (8318-8417) were not using
their assigned port. The executor always defaulted to 8317.

Changes:
- Add port field to ProfileDetectionResult interface
- Pass variant.port from profile-detector to ccs.ts
- Forward port to execClaudeWithCLIProxy options
- Update executor priority: CLI flags > variant port > config.yaml > default

Closes #228

* fix(cliproxy): propagate port in unified config and UI preset handlers

Edge case fixes identified in codebase review:
- Unified config variant detection: add settingsPath and port fields
- Provider editor: use variant port in handleApplyPreset/handleCustomPresetApply
- preset-utils: add optional port parameter to applyDefaultPreset()

* chore(release): 7.11.1-dev.1 [skip ci]

* fix(cliproxy): use correct default port (8317) for remote HTTP connections

Root cause: Inconsistent default port logic across code paths.
- Test Connection used 8317 (correct)
- Actual API calls used 80 (wrong)

Changes:
- Add centralized getRemoteDefaultPort() helper in config-generator.ts
- Fix proxy-target-resolver.ts to use shared helper
- Fix rewriteLocalhostUrls() and getRemoteEnvVars() in config-generator.ts
- Update remote-proxy-client.ts to use shared helper (DRY)

Fixes all 3 reported issues:
1. Port empty → now correctly uses :8317 instead of :80
2. BASEURL construction → now includes correct port
3. CLIProxy Plus auth → now fetches from remote on correct port

* chore(release): 7.11.1-dev.2 [skip ci]

* feat(delegation): add Claude Code CLI flag passthrough

Add explicit passthrough support for key Claude Code CLI flags:
- --max-turns: Limit agentic turns (prevents infinite loops)
- --fallback-model: Auto-fallback when model overloaded
- --agents: Dynamic subagent JSON injection
- --betas: Enable experimental features

Maintain extraArgs catch-all for future Claude Code flags.
Update help command with new "Delegation Flags" section.

Closes #89

* test(delegation): add comprehensive CLI flag passthrough tests

Add 45 test cases covering all edge cases for CLI flag passthrough:
- DelegationHandler: timeout/max-turns/fallback-model/agents/betas validation
- HeadlessExecutor: duplicate flag filtering, undefined vs truthy checks

* chore(release): 7.11.1-dev.3 [skip ci]

* fix(ui): enable cancel button during OAuth authentication

Resolves #234 - Cancel button was disabled during authentication flow,
preventing users from canceling the OAuth process.

Changes:
- Add auth-session-manager.ts for tracking active OAuth sessions
- Add POST /cliproxy/auth/:provider/cancel endpoint to abort sessions
- Kill spawned CLIProxy auth process when cancel is triggered
- Enable Cancel button in AddAccountDialog during authentication
- Add cancel support to QuickSetupWizard auth step
- Update useCancelAuth hook to call backend cancel endpoint

* chore(release): 7.11.1-dev.4 [skip ci]

* fix(prompt): add stdin.pause() to prevent process hang after password input

Fixes #236. The password() method called resume() on stdin but never
paused it in cleanup, keeping the event loop alive indefinitely.

* chore(release): 7.11.1-dev.5 [skip ci]

* feat(cliproxy): add --allow-self-signed flag for HTTPS connections (#227)

Previously, allowSelfSigned was hardcoded to true for all HTTPS protocol
connections, forcing use of the native https module which has issues with
Cloudflare-proxied connections causing timeouts.

This change:
- Adds --allow-self-signed CLI flag (default: false)
- Adds CCS_ALLOW_SELF_SIGNED environment variable
- Uses standard fetch API by default for HTTPS (works with valid certs)
- Only uses native https module when --allow-self-signed is specified

Usage:
- For production HTTPS proxies with valid certs: no flag needed
- For dev proxies with self-signed certs: use --allow-self-signed

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* chore(release): 7.11.1-dev.6 [skip ci]

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Shun Kakinoki <39187513+shunkakinoki@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 16:36:18 -08:00
kaitranntt 67a48a8305 fix(test): remove redundant build from beforeAll hook
CI already runs bun run build:all before validate step.
Duplicate build in test hook was causing timeout in CI.
2025-12-27 16:30:25 -05:00
kaitranntt ec2ee0a36d fix(tests): update test files for renamed getCliproxyConfigPath function
Update tests to use renamed function after refactoring getConfigPath
to getCliproxyConfigPath in cliproxy/config-generator.ts

Files updated:
- tests/unit/cliproxy/config-generator-port.test.js
- tests/unit/cliproxy/config-generator.test.js
2025-12-27 01:14:54 -05:00
kaitranntt ed6776aadc test(cliproxy): add comprehensive auth token test suite
- auth-token-manager.test.js: token generation, masking, inheritance (35 tests)
- tokens-command.test.js: CLI parsing and flag handling (24 tests)
- settings-routes-auth.test.js: API endpoint responses (22 tests)
- Total: 81 new tests covering all auth token functionality
2025-12-25 16:43:39 -05:00
Kai (Tam Nhu) TranandGitHub 459d730029 Merge pull request #184 from kaitranntt/kai/feat/variant-port-isolation
feat(cliproxy): add variant port isolation
2025-12-25 05:19:06 -05:00
kaitranntt 8f120b515f test(cliproxy): add integration tests for variant port isolation
Add comprehensive test suite mapping to PR #184 test plan:
- Create multiple variants with unique ports (8318-8417)
- Verify port persistence in config and separate config-{port}.yaml
- Run multiple variants concurrently with isolated sessions
- Verify list shows port column for each variant
- Remove variant cleans config, session, and port-specific files

25 new tests covering edge cases:
- Port exhaustion (100 variant max)
- Port reuse after deletion
- Legacy variants without port field
- Stale session cleanup for dead PIDs
- Default port special handling (sessions.json)
2025-12-25 05:15:49 -05: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
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
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 0bcaf4bc68 feat(cliproxy): add variant port isolation for concurrent proxy instances
Enables running multiple CLIProxy variants simultaneously on different
ports. Each variant now gets a unique port in the 18100-18199 range,
allowing concurrent use of providers like Gemini + Codex + custom variants.

Key changes:
- Add port field to variant config schema
- Implement automatic port allocation (18100 + variant index)
- Support variant-specific settings paths in config generator
- Display port in dashboard UI for debugging
- Show all models in variant editor dropdown
- Add comprehensive tests for port allocation edge cases

Closes related variant isolation work.
2025-12-24 04:15:04 -05: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
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
Kai (Tam Nhu) TranandGitHub 13dd5614a2 Merge pull request #168 from kaitranntt/kai/feat/openrouter-model-catalog
feat(openrouter): add model catalog integration with searchable picker and tier mapping
2025-12-20 23:58:50 -05:00
kaitranntt 4f4ab43eb3 refactor(config): remove secrets.yaml architecture
- delete secrets-manager.ts entirely

- remove secrets API routes and client methods

- simplify unified-config-types (remove vault/secrets)

- update profile-reader to remove secrets loading

- clean up unused hooks and API client methods
2025-12-20 23:10:35 -05:00
kaitranntt de45fa0da9 test(npm): update tests for preset-based profile creation
- update postinstall tests to expect empty profiles
- add test verifying GLM/GLMT/Kimi not auto-created
- update CLI profile tests to handle optional profiles
- remove hardcoded GLM profile expectations
2025-12-20 19:50:40 -05:00
kaitranntt df77745eca fix(update): correct dev version comparison semantic
- dev versions (X.Y.Z-dev.N) now treated as newer than base release (X.Y.Z)
- reflects convention that dev work is AFTER the release, not before
- update GH Actions message to use 'ccs update --dev' instead of npm install
- update tests to match new semantic
2025-12-20 19:48:05 -05:00
kaitranntt 55464c5c5c fix(cliproxy): improve remote proxy error messages
- Add DNS_FAILED and NETWORK_UNREACHABLE error codes
- Map "fetch failed" errors to NETWORK_UNREACHABLE for better UX
- Extract nested error cause for more accurate error detection
- Improve error messages with actionable hints

Fixes #142
2025-12-20 18:44:29 -05:00
kaitranntt 5e1d290865 fix(cliproxy): use /v1/models for remote proxy health check
CLIProxyAPI doesn't expose a /health endpoint, causing 404 errors
when testing remote proxy connections. Changed to use /v1/models
which is always available and returns 200 when operational.

Fixes #142
2025-12-20 18:18:11 -05:00
kaitranntt b6b18173cc fix(update-checker): resolve dev channel update and duplicate comments
Fixes tag-agnostic cache issue causing 'ccs update --dev' to require
force. Implements tag-specific caching (dev_version vs latest_version)
to correctly detect updates across channels. Disables duplicate bot
comments on dev releases in .releaserc.cjs.
2025-12-19 04:50:09 -05:00
kaitranntt a3b172cc43 fix(cliproxy): register session on dashboard start and add port-based stop fallback
Dashboard Stop/Update buttons failed with contradictory errors:
- Stop: "No active CLIProxy session found"
- Update: "CLIProxy was already running"

Root cause: service-manager spawned proxy but never called registerSession(),
so stopProxy() couldn't find the lock file.

Changes:
- service-manager.ts: Add registerSession() after spawn
- session-tracker.ts: Make stopProxy() async with port-based fallback
- routes.ts: Update proxy-stop endpoint to async
- cliproxy-command.ts: Update handleStop() to await async stopProxy()
- port-utils.ts: Fix double-escaped regex for Windows port detection
- session-tracker.test.js: Update tests for async stopProxy()
2025-12-19 03:57:06 -05:00
kaitranntt 30d564cda6 feat(cliproxy): add remote proxy client for health checks
- checkRemoteProxy() tests remote CLIProxyAPI /health endpoint

- testConnection() validates remote proxy connectivity

- typed error codes: CONNECTION_REFUSED, TIMEOUT, AUTH_FAILED, UNKNOWN

- support for self-signed certificates with allowSelfSigned flag

- add type-level tests for interfaces
2025-12-19 01:13:54 -05:00
kaitranntt 68a93f0500 feat(cliproxy): add proxy config resolver with CLI flag support
- parseProxyFlags() extracts --proxy-host, --proxy-port, --proxy-protocol

- getProxyEnvVars() reads CCS_PROXY_* environment variables

- resolveProxyConfig() merges CLI > ENV > config.yaml > defaults

- hasProxyFlags() detects proxy-related CLI arguments

- add 29 comprehensive unit tests
2025-12-19 01:12:46 -05:00
kaitranntt 126cffc6dc refactor: remove deprecated native shell installers
- Remove installers/ directory (install.sh, install.ps1, uninstall.sh, uninstall.ps1)
- Update CloudFlare worker to 301 redirect /install* to npm docs
- Remove detectInstallationMethod() - npm is now only install method
- Simplify update-command.ts to npm-only updates
- Clean up tests to remove direct install references

BREAKING CHANGE: Native shell installers (curl/irm) no longer work.
Use `npm install -g @kaitranntt/ccs` instead.
2025-12-18 16:52:57 -05:00
kaitranntt 770c17e71c test(cliproxy): add lifecycle tests for stop/status commands
Add comprehensive unit tests for CLIProxy proxy lifecycle:
- Status command logic: session lock exists/not, uptime formatting
- Stop command logic: stale lock cleanup, active proxy stop
- Command routing: stop/status subcommands, unknown handling

Tests cover the CLI handlers for the new proxy persistence feature.
2025-12-18 01:37:24 -05:00
kaitranntt 81463eda65 test(cliproxy): add tests for stopProxy and getProxyStatus
Add unit tests for the new session tracker functions:
- stopProxy: error handling, stale lock cleanup, success structure
- getProxyStatus: not running, full status, dead proxy cleanup, session count
2025-12-18 01:04:33 -05:00
kaitranntt 925ac8e1d4 feat(cliproxy): remove thinking token cap and update agy haiku model
- Removed MAX_THINKING_TOKENS (8191) limit for Claude models via agy.
- Updated default agy haiku model to gemini-3-flash-preview.
- Updated unit tests to match new model expectations.
2025-12-17 16:51:23 -05:00
kaitranntt 3629e3e2fb fix(cliproxy): prevent shared proxy termination on multi-session exit
Add session tracking with reference counting for CLIProxy instances.
Multiple CCS sessions now safely share a single proxy on port 8317.
When any session exits, proxy only terminates if it was the last session.

Changes:
- Add session-tracker.ts: lock file based reference counting
- Modify cliproxy-executor.ts: reuse existing proxy, conditional cleanup
- Add 21 unit tests for session tracker functionality

Fixes #118
2025-12-17 01:36:34 -05:00
kaitranntt 071ec041ed feat(websearch): add multi-tier MCP fallback for third-party profiles
Implements CCS WebSearch Native Infrastructure (Phases 1-3):

Phase 1 - Multi-tier MCP Fallback:
- Add mcp-manager.ts with ensureMcpWebSearch() for auto-configuration
- Support web-search-prime (primary), Brave Search, and Tavily MCPs
- Case-insensitive detection of existing web search MCPs
- Block-websearch hook for optional native WebSearch blocking

Phase 2 - User Configuration:
- Add WebSearchConfig interface to unified-config-types.ts
- Add getWebSearchConfig() to unified-config-loader.ts
- Support configurable webSearchPrimeUrl for security
- Add GET/PUT /api/websearch endpoints in routes.ts
- Add WebSearch settings UI in settings.tsx dashboard

Phase 3 - Documentation & Testing:
- Add WebSearch section to README.md
- Create comprehensive docs/websearch.md guide
- Add 23 unit tests for MCP manager logic

Enables web search for gemini, codex, agy, qwen, glm, kimi profiles
that cannot access Anthropic's native WebSearch API.
2025-12-16 00:42:13 -05:00
kaitranntt d343abca53 fix(config): prevent profile loss from strict config validation
Relaxed isUnifiedConfig() type guard to accept version >= 1 and partial
configs. Added mergeWithDefaults() to preserve user data while filling
missing sections. Fixes profile "not found" after terminal restart.

Closes #82
2025-12-12 05:12:08 -05:00
kaitranntt 790ac3c862 fix(cache): use ~/.ccs/cache/ for usage and update-check files
- usage-disk-cache.ts: usage-cache.json → cache/usage.json
- update-checker.ts: update-check.json → cache/update-check.json
- Both ensure cache directory exists before writing
- Update tests to use new cache paths
2025-12-10 18:32:35 -05:00
kaitranntt b621b8e47b feat(config): add unified YAML config with migration support
Implements unified config.yaml format consolidating:
- config.json (API profiles)
- profiles.json (account metadata)
- *.settings.json (env vars)

Features:
- Auto-migration from v1 JSON to v2 YAML with backup
- Secrets separation into secrets.yaml (chmod 600)
- Enhanced YAML output with section comments
- CLIProxy OAuth settings migration with env var support
- Feature flag for gradual rollout (CCS_UNIFIED_CONFIG=1)
- Rollback support via ccs migrate --rollback

New commands:
- ccs migrate - Run migration
- ccs migrate --dry-run - Preview changes
- ccs migrate --rollback <path> - Restore from backup
- ccs migrate --list-backups - List available backups

Closes #75
2025-12-10 17:42:40 -05:00
kaitranntt 49b4065186 feat(usage): add internal data aggregation and cost tracking 2025-12-09 23:41:47 -05:00
kaitranntt 1475adb616 feat(cliproxy): promote thinking models as default for agy provider
- Remove deprecated flag from Claude Opus 4.5 Thinking and Sonnet 4.5 Thinking
- Reorder models with thinking models at top (Opus → Sonnet Thinking → Sonnet → Gemini)
- Change default model to gemini-claude-opus-4-5-thinking
- Update tests to reflect new ordering and non-deprecated status
2025-12-08 23:21:17 -05:00
kaitranntt 63b3ca7760 feat(cliproxy): deprecate claude thinking models in agy provider
Deprecated 2 Claude thinking models:
- gemini-claude-opus-4-5-thinking
- gemini-claude-sonnet-4-5-thinking

These models have compatibility issues with Antigravity.
A new deprecation system was added with badges and warnings in the UI.
2025-12-06 08:44:09 -05:00
kaitranntt 6427ecf5af feat(cliproxy): add crud commands for variant profiles
- Add `ccs cliproxy create/list/remove` commands for variant management
- Interactive wizard with provider/model selection from catalog
- Settings file auto-generated with all 6 ANTHROPIC_* env fields
- Fix `ccs api create` to include all 4 model fields (was missing 3)
- Fix `--config` flag to save to correct variant settings file
- Remove paid tier badge from AGY models (all free via Antigravity)
- Add settings file format example to README for CLIProxy variants
- Add 22 unit tests for cliproxy command validation and config handling
2025-12-05 21:44:41 -05:00
kaitranntt 20b7bae046 refactor(cliproxy): use centralized ui system for model config display
Replace custom formatting with ui.ts imports (color, bold, dim, ok, info,
header, initUI) to maintain consistent styling with ccs doctor. Add model
descriptions to catalog and clarify [Paid API] tier labeling. Update
showCurrentConfig to async for UI initialization. Improves code reuse and
visual consistency across CLI commands.
2025-12-04 05:29:55 -05:00
kaitranntt df31ffcee7 fix(prompt): strip bracketed paste escape sequences from password input
Terminals using bracketed paste mode wrap pasted content with ESC[200~
(start) and ESC[201~ (end) sequences. These were incorrectly passed
through to API keys, causing "[200~API_KEY[201~" instead of "API_KEY".

Now buffers ESC sequences and discards recognized paste markers.
2025-12-04 05:05:45 -05:00
kaitranntt 3bdbff9345 feat(prompt): add password input utility with masking
Adds new password prompt utility with customizable masking for secure
credential collection. Integrates with help command for improved UX.
2025-12-04 04:45:26 -05:00
kaitranntt 4654c15577 feat(cliproxy): add model catalog with configuration management
Introduces new model-catalog and model-config modules to manage LLM
provider configurations and aliases. Enables dynamic model selection
with validated configuration per provider.
2025-12-04 04:45:11 -05:00
semantic-release-botandkaitranntt bd46c8de12 fix(tests): migrate test suite from mocha to bun test runner
- Replace before()/after() with beforeAll()/afterAll()
- Remove this.timeout() calls (unsupported by bun)
- Update package.json scripts to use bun test
- Fix error message regex for cross-runtime compatibility
- Skip integration tests requiring network/child process mocking
- Format source files with prettier
2025-12-03 21:43:29 -05:00
kaitranntt a6663cbd04 fix(cliproxy): convert windows backslashes to forward slashes in config.yaml auth-dir
Fixes #36

Windows paths with backslashes caused YAML parsing failures because
backslashes are escape characters in double-quoted strings. Forward
slashes work correctly on all platforms and avoid escape sequence issues.

Changes:
- src/cliproxy/config-generator.ts: Add .replace(/\\/g, '/') to authDir
- tests/unit/cliproxy/config-generator.test.js: Add 12 unit tests

Tests: 169/169 unit tests passing
2025-12-02 16:16:21 -05:00
kaitranntt 716193a682 feat(ui): enhance delegation with listr2 task lists and styled output
Phase 5 of CLI UI/UX Enhancement - Delegation + Listr2

Added Listr2 integration for enhanced delegation progress display:
- Intelligent renderer selection (TTY/CI/Claude Code context detection)
- Styled result boxes and tables using ui layer
- Graceful fallback chain: Listr2 → Spinners → Plain text
- All delegation formatters converted to async

Changes:
- src/utils/ui.ts: Added taskList wrapper, isClaudeCodeContext detection
- src/delegation/result-formatter.ts: Async formatting with styled boxes/tables
- src/delegation/delegation-handler.ts: Async format calls
- src/delegation/headless-executor.ts: UI layer progress messages
- tests: Updated all formatter tests to handle async
- docs: Enhanced code standards and codebase summary

All validation passing (157/157 tests)
Phase 5 complete - All 5 phases delivered
2025-12-01 20:53:04 -05:00
kaitranntt 6e49e0e7e1 feat(ui): add central ui abstraction layer for cli styling
- create src/utils/ui.ts with semantic colors, status indicators, boxes, tables, spinners
- add ui types (SemanticColor, BoxOptions, TableOptions, SpinnerOptions) to src/types/utils.ts
- add deprecation notice to src/utils/helpers.ts for legacy color functions
- add unit tests for ui module (11 test cases)
- install chalk@5.6.2, boxen@8.0.1, gradient-string@3.0.0

features:
- semantic color system (success, error, warning, info, primary, secondary)
- ascii-only status indicators: [OK], [X], [!], [i]
- tty-aware with NO_COLOR/FORCE_COLOR support
- styled boxes with boxen (round, double, bold borders)
- formatted tables with cli-table3
- animated spinners with ora (fallback to plain text in non-tty)
- gradient text for headers (cyan-to-blue)
- lazy esm module loading for chalk/boxen/gradient-string
2025-12-01 19:22:51 -05:00