Commit Graph
347 Commits
Author SHA1 Message Date
kaitranntt 71335a6193 feat(ui): add auth tokens settings tab
- Add AuthSection component with API key and management secret inputs
- Show/hide toggle, copy to clipboard, regenerate secret button
- Reset to defaults action with disabled state when using defaults
- Add Auth tab to settings navigation with KeyRound icon
- Update SettingsTab type to include 'auth'
2025-12-25 14:37:03 -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
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
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
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 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 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 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 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
kaitranntt a827b73eef feat(glm): add GLM 4.7 model support
- Update default GLM/GLMT model from glm-4.6 to glm-4.7
- Add glm-4.7 pricing entry
- Sync UI presets with CLI changes

Closes #179
2025-12-22 16:13:19 -05:00
kaitrannttandMinhOmega 31bafaab8d feat(api): add Azure Foundry preset
Add Microsoft Azure AI Foundry as a provider preset for `ccs api create`.

Usage: `ccs api create --preset foundry`

This is a cleaner implementation than the postinstall-based approach,
leveraging the existing preset system.

Co-authored-by: MinhOmega <49482201+MinhOmega@users.noreply.github.com>
2025-12-22 15:34:27 -05:00
kaitranntt 92215457f0 feat(ui): add kiro and ghcp to wizard, auth flow, and settings
- update PROVIDERS in wizard constants with ghcp

- add AUTH_ENDPOINTS for qwen, iflow, kiro, ghcp

- update globalenv description text
2025-12-22 00:48:10 -05:00
kaitranntt 099b712d4a feat(ui): update cliproxy components with kiro and ghcp providers
- add ghcp to PROVIDER_IMAGES and PROVIDER_CONFIG in provider-logo

- update providers array and options in cliproxy-dialog

- add kiro and ghcp to providerLabels in cliproxy-table

- complete providers list in cliproxy-header

- update ownerMap key from copilot to ghcp in provider-editor
2025-12-22 00:47:34 -05:00
kaitranntt bf3d51ade3 feat(ui): add kiro and ghcp to provider types and configs
- update Variant, CreateVariant, UpdateVariant, OAuthAccount types

- add ghcp to PROVIDER_ASSETS, PROVIDER_COLORS, PROVIDER_NAMES

- add ghcp catalog with model configurations
2025-12-22 00:46:51 -05:00
kaitranntt af92bc30bf refactor: complete CLIProxy Plus branding across CLI and UI
CLI changes:
- platform-commands.ts: Update taskkill/pkill to use cli-proxy-api-plus binary name
- help-command.ts: Fix binary path display to show cli-proxy-api-plus
- oauth-process.ts: Update auth error message
- binary-manager.ts: Update removal message
- cliproxy-executor.ts: Update startup failure messages
- cliproxy-command.ts: Update variant creation messages
- service-manager.ts: Update startup error message
- cliproxy-stats-routes.ts: Update all API error messages

UI changes:
- proxy/index.tsx: Update connection mode descriptions
- cliproxy-stats-overview.tsx: Update metrics description
- model-preferences-grid.tsx: Update models description
2025-12-21 23:17:04 -05:00
kaitranntt 670993d364 refactor: rename CLIProxyAPI to CLIProxy Plus across UI and CLI
- Update cliproxy-command.ts status output and install messages
- Update help-command.ts with Plus branding and new kiro/copilot providers
- Update doctor.ts header to show CLIPROXY PLUS
- Update cliproxy-check.ts binary check output
- Update proxy-status-widget.tsx label to CLIProxy Plus
- Point release URLs to CLIProxyAPIPlus repository
2025-12-21 22:57:03 -05:00
kaitranntt 0f029f960a feat(ui): integrate Kiro and Copilot providers, rename to CLIProxy Plus
- Rename sidebar/header from CLIProxy to CLIProxy Plus
- Add Kiro and Copilot to all provider lists and type unions
- Add provider logos and color configs
- Add model catalogs with upstream CLIProxyAPIPlus models
- Update Quick Setup Wizard with new providers
2025-12-21 22:27:36 -05:00
kaitranntt 9ca20e70de feat(ui): add Kiro and Copilot provider icons
- Add kiro.png icon for Kiro (AWS) provider
- Add copilot.svg icon for GitHub Copilot provider
2025-12-21 22:26:53 -05:00
kaitranntt 28c62625b3 fix(cliproxy): merge dev with proper remote mode integration
Resolve conflicts in cliproxy-auth-routes.ts by combining:
- Dev's improved error handling with try-catch patterns
- Branch's remote mode routing logic

All 638 tests pass.
2025-12-21 19:21:29 -05:00
kaitranntt e84df00740 fix(ui): correct cliproxy account API paths
- Change /cliproxy/accounts/* to /cliproxy/auth/accounts/*
- Fix 404 errors when managing CLIProxy accounts from dashboard
- Root cause: frontend called wrong endpoints for account management
2025-12-21 18:02:38 -05:00
kaitranntt 3bf9ebe32a feat(ui): add remote mode indicator to provider editor header
Shows "Remote" badge with Globe icon and "Traffic auto-routed to
remote server" message when remote CLIProxy mode is active.
2025-12-21 04:34:29 -05:00
kaitranntt f15b989508 fix(hooks): memoize return objects to prevent infinite render loops
Apply useMemo to hook returns that create new object references on each
render. This prevents downstream useEffect/useCallback dependencies from
detecting false changes and triggering re-execution.

Fixed hooks:
- PrivacyProvider: memoize context value and toggle callback
- useCopilot: wrap large return object with all dependencies
- useWebSocket: memoize status/connect/disconnect object
- useProjectSelection: memoize state and handlers object
- useCliproxyAuthFlow: memoize spread state with auth functions
- useAnalyticsPage: memoize apiOptions to stabilize query params
2025-12-21 04:17:32 -05:00
kaitranntt d86dfab2e7 feat(ui): show remote server info in ProxyStatusWidget
- Add remote mode detection via cliproxy-server-config query
- Display blue-themed "Remote Proxy" widget when remote enabled
- Show remote host and "Traffic auto-routed" message
- Hide local start/stop/restart controls in remote mode
2025-12-21 04:14:55 -05:00
kaitranntt 4f75e105a9 fix(settings): memoize useSettingsActions to prevent infinite render loop
- wrap return object in useMemo with all action callbacks as deps

- prevents new object reference on every render

- fixes Maximum update depth exceeded error on settings page
2025-12-21 04:09:13 -05:00
kaitranntt 3fca9338f9 test(ui): add vitest testing infrastructure with 99 unit tests
- add vitest, jsdom, testing-library, msw dependencies
- create test setup: vitest-setup.ts, test-utils.tsx, msw-handlers.ts
- add 99 unit tests covering settings, analytics, auth-monitor utils
- configure 90% coverage thresholds on pure-logic files
- add test scripts: test, test:run, test:coverage, test:ui
2025-12-21 03:28:34 -05:00
kaitranntt 8ead6fa0bf refactor(ui): modularize auth-monitor into directory structure
- split auth-monitor.tsx (465 lines) into modular components
- extract provider-card, summary-card, live-pulse, inline-stats-badge
- separate hooks, types, and utils for better maintainability
- export types from monitoring barrel
2025-12-21 03:27:53 -05:00
kaitranntt 03d9bf76c4 refactor(ui): modularize analytics page into directory structure
- split analytics.tsx (420 lines) into modular components
- extract analytics-header, charts-grid, cost-by-model-card
- add analytics-skeleton for loading states
- separate hooks, types, and utils
2025-12-21 03:27:15 -05:00
kaitranntt 104a404144 refactor(ui): modularize settings page into directory structure
- split settings.tsx (1,781 lines) into modular components
- extract hooks into separate files (context-hooks, use-*-config)
- create sections: websearch, proxy, globalenv with subcomponents
- add tab-navigation and section-skeleton components
- add settings-context.ts for state management
2025-12-21 03:26:40 -05:00
kaitranntt 883d9fa585 fix(ui): hide local paths in remote CLIProxy mode 2025-12-21 02:56:24 -05:00
kaitranntt eaf566beac feat(ui): add visual feedback for WebSearch model auto-save
- Add 'Saved' indicator with checkmark for Gemini/OpenCode model inputs

- Show indicator for 2 seconds after successful save on blur

- Uses fade-in animation for smooth UX

Closes #164
2025-12-21 01:47:18 -05:00
kaitranntt 86d992fce6 fix(ui): fix profile switching and improve UX
- Add key prop to ProfileEditor to force remount on profile change

- Reset editorHasChanges on discard confirmation

- Add text-white to destructive dialog button

- Change OpenRouter default model to claude-opus-4.5
2025-12-21 01:20:57 -05:00
kaitranntt b790005c85 fix(ui): add unsaved changes confirmation when switching profiles
- Add onHasChangesUpdate callback to ProfileEditor

- Track editor dirty state in ApiPage parent

- Show confirmation dialog before discarding unsaved changes

- Handle edge case for 'New' profile button

Closes #163
2025-12-21 01:05:23 -05:00
kaitranntt cdb465342e fix(cliproxy): address code review findings for remote routing
- Add runtime API response validation in remote-auth-fetcher
- Add AbortController cleanup to prevent state updates after unmount
- Validate postMessage origin matches iframe src before sending creds
- Mask auth token display (show ***last4) for security
- Reset error/connected state on refresh
- Fix port default to use protocol-based (443 for https, 80 for http)
- Normalize path in buildProxyUrl to ensure leading slash
- Add fallback for undefined email (default to 'Unknown')
- Extract timeout constant (REMOTE_FETCH_TIMEOUT_MS)
- Remove unused RemoteAuthFilesResponse interface
2025-12-21 00:42:54 -05:00
kaitranntt bfa55e041c feat(ui): dynamic control panel embed for remote CLIProxy
- Use React Query to fetch cliproxy_server config
- Build URLs dynamically based on remote/local mode
- Add Globe icon and Remote badge indicator
- Show context-aware error messages for remote failures
2025-12-21 00:42:54 -05:00
kaitranntt a08aef9fb7 feat(ui): add OpenRouter badge to API Profiles sidebar item
Shows compact OpenRouter indicator badge with icon and tooltip
(349+ models). Badge colors adapt for proper contrast on hover
and active states in both light and dark themes.
2025-12-21 00:08:45 -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 f41d361fe5 fix(openrouter): show all env vars except API key in Additional Variables
Only hide ANTHROPIC_AUTH_TOKEN (has dedicated input). Show all other
env vars (BASE_URL, MODEL, tier models, API_KEY, etc.) in the
"Additional Variables" section for full visibility.
2025-12-20 23:47:14 -05:00
kaitranntt 70bc44eb11 fix(openrouter): add ANTHROPIC_API_KEY="" default for OpenRouter profiles
Per OpenRouter requirements, explicitly blank out the Anthropic API key
to prevent conflicts when using OpenRouter's API. The key is visible in
the "Additional Variables" section of the profile editor.
2025-12-20 23:43:52 -05:00
kaitranntt ebc8ee2638 feat(openrouter): prioritize Exacto models for better agentic performance
- Add isExacto field to CategorizedModel for models with :exacto suffix
- Add sortModelsByPriority function (Free > Exacto > Regular)
- Apply priority sorting within each category in model picker
- Add visual "Exacto" badge (green outline) for exacto variants

Exacto models are OpenRouter's specialized variants optimized for
tool use and agentic behaviors, recommended for Claude Code.
2025-12-20 23:38:07 -05:00
kaitranntt 7d4961e7a9 fix(openrouter): correct ANTHROPIC_BASE_URL to https://openrouter.ai/api
Update OPENROUTER_BASE_URL in provider presets (CLI and UI) which is
used as ANTHROPIC_BASE_URL when creating OpenRouter profiles.
2025-12-20 23:31:11 -05:00
kaitranntt 723ce28431 fix(ui): model selection now updates all tiers correctly
- Add updateEnvBulk function for atomic multi-key updates
- Pass onEnvBulkChange prop to FriendlyUISection
- Fixes race condition where only last tier (haiku) was updated
2025-12-20 23:23:50 -05:00
kaitranntt f947aeb21b feat(ui): add value input for new environment variables
- Add newEnvValue state to profile editor
- Update add variable section to include key + value inputs
- Apply to both OpenRouter and standard profile editors
- Clear both key and value after adding variable
2025-12-20 23:22:04 -05:00
kaitranntt 3f7add5c10 fix(ui): deduplicate API key and restore add variable input
- Add ANTHROPIC_AUTH_TOKEN to openRouterManagedKeys set
- Change collapsible section from "All Environment Variables" to "Additional Variables"
- Only show non-managed env vars in the collapsible section
- Restore "Add Environment Variable" input at bottom of OpenRouter view
2025-12-20 23:17:18 -05:00
kaitranntt 2b6600abd7 fix(ui): resolve Radix ScrollArea viewport overflow
- override inline display:table style causing content expansion

- force min-width:0 on viewport child div
2025-12-20 23:11:52 -05:00
kaitranntt 7788137f1c feat(ui): add streamlined OpenRouter profile editor
- redesign friendly-ui-section with OpenRouter-specific view

- add model selection, tier mapping, API key sections

- compact ModelItem layout for better space efficiency

- add onEnvBulkChange prop for atomic env updates
2025-12-20 23:11:15 -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