Commit Graph
653 Commits
Author SHA1 Message Date
Kai (Tam Nhu) TranandGitHub efdf53c83c Merge pull request #138 from kaitranntt/kai/feat/copilot-integration
feat(copilot): add GitHub Copilot integration with CLI, API, and dashboard
2025-12-18 05:41:38 -05:00
kaitranntt da5dc31ec4 fix(ui): constrain copilot config left panel width to 540px 2025-12-18 05:31:37 -05:00
github-actions[bot] 7a668dd8eb chore(release): 6.4.0-dev.1 [skip ci] 2025-12-18 10:29:18 +00:00
kaitranntt f9b89dee12 fix(ui): improve copilot sidebar logical order and remove redundancy
Changes:
- Reordered sidebar to follow logical flow:
  1. Setup: copilot-api binary → Integration enabled
  2. Auth: GitHub connection (only after binary installed)
  3. Daemon: status/port (only after authenticated)
- Removed redundant Config section (Model/Account already in right panel)
- Progressive disclosure: sections appear as prerequisites are met
2025-12-18 05:26:58 -05:00
kaitranntt 60c01c7e60 fix(ui): handle 404 errors in profile settings fetch
- throw on non-OK responses in ProfileEditor queryFn
- add isError state with user-friendly message and retry button
- add defensive null check for data.path before .replace() call
- apply same defensive check to provider-editor.tsx

Fixes blank screen when API profile settings file doesn't exist.
2025-12-18 05:25:52 -05:00
kaitranntt ec6face8db fix(copilot): use gpt-4.1 as default model and 127.0.0.1 for local connections
Key changes:
- Changed default model from claude-sonnet-4.5 to gpt-4.1 (free tier compatible)
- Updated all Claude models to minPlan: 'pro' (requires paid Copilot subscription)
- Replaced 'localhost' with '127.0.0.1' for more reliable local connections
  (bypasses DNS resolution and potential IPv6 issues)
- Updated UI presets: replaced Claude Haiku with Raptor Mini in free tier
- Fixed FREE_PRESETS to only include actually free models

This fixes the "model_not_supported" error when using free tier GitHub Copilot
subscription, which doesn't have access to Claude models.
2025-12-18 04:58:49 -05:00
kaitranntt 2c6dfe746b fix(cli): allow ccs copilot as profile by routing only known subcommands
Changed copilot command routing logic to only intercept known subcommands
(auth, status, models, start, stop, enable, disable, help). When user runs
bare 'ccs copilot' without subcommands, it now falls through to profile
detection and executes Claude with the Copilot API backend.

This allows:
- `ccs copilot auth` → command handler (authenticate)
- `ccs copilot status` → command handler (show status)
- `ccs copilot` → profile execution (run Claude with Copilot)
2025-12-18 04:47:44 -05:00
kaitranntt 3a7cb0c4e8 docs(cli): improve copilot help with quick start guide 2025-12-18 04:43:35 -05:00
kaitranntt 671a9e76fb fix(cli): route 'ccs copilot' without subcommand to help 2025-12-18 04:34:33 -05:00
semantic-release-bot d746ec77ca chore(release): 6.4.0 [skip ci]
# [6.4.0](https://github.com/kaitranntt/ccs/compare/v6.3.1...v6.4.0) (2025-12-18)

### Bug Fixes

* **websearch:** detect Gemini CLI auth status before showing Ready ([98c21ef](https://github.com/kaitranntt/ccs/commit/98c21efb5a3b7a39b27fda958691837545235f2d))

### Features

* **cliproxy:** implement interactive project selection for OAuth flows ([a66abba](https://github.com/kaitranntt/ccs/commit/a66abba174eb77555b4443f3e930be30264da7e4))
2025-12-18 09:25:16 +00:00
Kai (Tam Nhu) TranandGitHub f7cf30fac4 Merge pull request #136 from kaitranntt/dev
feat(cliproxy): implement interactive project selection for OAuth flows
2025-12-18 04:24:15 -05:00
github-actions[bot] 898198ad6e chore(release): 6.3.1-dev.3 [skip ci] 2025-12-18 09:23:56 +00:00
kaitranntt a9788d02ea docs(copilot): add prominent disclaimer for unofficial API
Make the "use at your own risk" warning more transparent:
- UI: Expanded warning banner with clear "Unofficial API" heading
- UI: Added explicit no warranty/no responsibility text
- Config YAML: Updated comments with !! DISCLAIMER !! section
- Types: Updated CopilotConfig JSDoc with full disclaimer

CCS provides no warranty and accepts no responsibility for
consequences of using this reverse-engineered GitHub Copilot API.
2025-12-18 04:20:58 -05:00
kaitranntt 87c2acc416 feat(ui): display plan tiers and presets in copilot model selector
- Add CopilotPlanTier type and extend CopilotModel with minPlan,
  multiplier, preview fields
- Show plan tier badges (free/pro/pro+/business/enterprise) with
  color-coded styling in model dropdown
- Display multiplier info (0x=free, 1x=standard, 3x-10x=premium)
- Add Preview badge for non-GA models
- Create 3 free tier presets: GPT-4.1, GPT-5 Mini, Claude Haiku 4.5
- Create 5 paid presets: Claude Opus/Sonnet 4.5, GPT-5.2,
  GPT-5.1 Codex Max, Gemini 2.5 Pro
- Separate presets into Free Tier and Pro+ Required sections
2025-12-18 04:15:08 -05:00
kaitranntt a66abba174 feat(cliproxy): implement interactive project selection for OAuth flows
- Add ProjectSelectionHandler to parse and handle CLIProxy project prompts
- Integrate project selection into AuthHandler with UI-first support
- Add project selection API endpoints and WebSocket events
- Implement ProjectSelectionDialog and useProjectSelection hook in UI
- Fixes macOS OAuth timeout by handling interactive project selection via UI
2025-12-18 04:11:59 -05:00
kaitranntt 7653caba71 feat(copilot): add complete model catalog with plan tiers
Add 19 GitHub Copilot supported models with metadata:
- Anthropic: claude-sonnet-4.5, claude-sonnet-4, claude-opus-4.5,
  claude-opus-4.1, claude-haiku-4.5
- OpenAI: gpt-5.2, gpt-5.1-codex-max, gpt-5.1-codex, gpt-5.1-codex-mini,
  gpt-5.1, gpt-5-codex, gpt-5, gpt-5-mini, gpt-4.1
- Google: gemini-3-pro, gemini-3-flash, gemini-2.5-pro
- xAI: grok-code-fast-1
- Fine-tuned: raptor-mini

Each model includes:
- minPlan: free, pro, pro+, business, enterprise
- multiplier: 0 = free tier, 0.25-0.33 = cheap, 1 = standard, 3-10 = premium
- preview: boolean for non-GA models

Update default model to claude-sonnet-4.5 (standard multiplier).
2025-12-18 03:48:47 -05:00
github-actions[bot] a87ef973fc chore(release): 6.3.1-dev.1 [skip ci] 2025-12-18 08:26:14 +00:00
kaitranntt 98c21efb5a fix(websearch): detect Gemini CLI auth status before showing Ready
Previously, WebSearch status showed "Ready (Gemini)" when the CLI binary
was installed, misleading users who hadn't authenticated yet.

Changes:
- Add isGeminiAuthenticated() to check ~/.gemini/oauth_creds.json
- Add 'needs_auth' state to WebSearchReadiness type
- Show warning "[!] Gemini: run 'gemini' to login" when not authenticated
- Fix incorrect 'gemini auth login' references (no such command exists)
- Update docs with correct npm install and authentication instructions
2025-12-18 03:24:59 -05:00
kaitranntt 5f0fde9a61 feat(ui): expose auth result with device code in hook
- add CopilotAuthResult interface with deviceCode field

- expose startAuthAsync and authResult from useCopilot hook

- immediately refetch status on auth success
2025-12-18 03:01:12 -05:00
kaitranntt 4783632958 fix(copilot): use token file check for instant auth status
- add hasTokenFile() for fast auth check without subprocess

- capture device code from copilot-api auth output

- export AuthFlowResult type with deviceCode and verificationUrl

- echo auth output to terminal while capturing for UI
2025-12-18 03:00:43 -05:00
semantic-release-bot f3a6f4ef4e chore(release): 6.3.1 [skip ci]
## [6.3.1](https://github.com/kaitranntt/ccs/compare/v6.3.0...v6.3.1) (2025-12-18)

### Bug Fixes

* **ui:** limit Connection Timeline to 100 events to prevent lag ([170dcdc](https://github.com/kaitranntt/ccs/commit/170dcdc44f825bb64bedd7eb53fff6127ca94bce))
2025-12-18 07:56:16 +00:00
Kai (Tam Nhu) TranandGitHub 576d282356 Merge pull request #134 from kaitranntt/dev
fix(ui): limit Connection Timeline events to prevent lag
2025-12-18 02:55:18 -05:00
kaitranntt 3865747154 fix(ui): add install button to copilot page sidebar
- show Install copilot-api button when not installed

- display version in status when installed
2025-12-18 02:38:58 -05:00
github-actions[bot] b98c428a89 chore(release): 6.3.0-dev.1 [skip ci] 2025-12-18 07:32:22 +00:00
kaitranntt 170dcdc44f fix(ui): limit Connection Timeline to 100 events to prevent lag
- add MAX_TIMELINE_EVENTS constant (100)

- slice events in useMemo to cap DOM elements

- prevents UI freeze with high request counts
2025-12-18 02:30:47 -05:00
kaitranntt f813ad06f6 feat(ui): add copilot-api install button and version display
- add CopilotInfo type and install mutation to useCopilot hook

- show version in status card when installed

- add Install button with loading state when not installed
2025-12-18 02:27:35 -05:00
kaitranntt fee241d00b feat(api): add copilot install and info endpoints
- POST /api/copilot/install: install copilot-api (optional version)

- GET /api/copilot/info: get install status, version, path

- GET /api/copilot/status: include version in response
2025-12-18 02:27:11 -05:00
kaitranntt 9a8eea82c5 refactor(copilot): use local installation from package manager
- copilot-auth: use getCopilotApiBinPath() instead of npx

- copilot-daemon: move PID file to ~/.ccs/copilot/daemon.pid

- copilot-executor: auto-install copilot-api on first use

- index: export package manager functions
2025-12-18 02:26:46 -05:00
kaitranntt ecdad1d6d0 feat(copilot): add self-managed package manager for copilot-api
- install copilot-api locally to ~/.ccs/copilot/

- auto-update with version caching (1hr TTL)

- version pinning support via .version-pin file

- mirrors CLIProxy binary-manager pattern
2025-12-18 02:26:11 -05:00
semantic-release-bot 15927b8e58 chore(release): 6.3.0 [skip ci]
# [6.3.0](https://github.com/kaitranntt/ccs/compare/v6.2.1...v6.3.0) (2025-12-18)

### Bug Fixes

* **dashboard:** detect legacy proxy instances without session lock ([85cfbde](https://github.com/kaitranntt/ccs/commit/85cfbde5fd95850a28e962be01fc8655a69e8b1c))

### Features

* **cliproxy:** default session persistence for CLIProxy ([a7450bd](https://github.com/kaitranntt/ccs/commit/a7450bdffeb9679a02608cb76686e006afa6455f)), closes [#129](https://github.com/kaitranntt/ccs/issues/129)
* **dashboard:** add CLIProxy status widget with start button ([589cd2c](https://github.com/kaitranntt/ccs/commit/589cd2c2b7607b1092f6ee1ce4bf044269ba05e5))
2025-12-18 06:49:10 +00:00
Kai (Tam Nhu) TranandGitHub 1f0e270fca Merge pull request #131 from kaitranntt/dev
feat(release): CLIProxy session persistence and dashboard status widget
2025-12-18 01:48:13 -05:00
github-actions[bot] 1a140e4a32 chore(release): 6.2.1-dev.2 [skip ci] 2025-12-18 06:46:12 +00:00
kaitranntt b4a63b6b71 docs(claude): restructure CLAUDE.md for clearer quality gate workflow
- Add Common Mistakes section to prevent format step being skipped
- Make pre-commit sequence explicit: format → lint:fix → validate
- Explain WHY this order matters (validate only checks, doesn't fix)
- Condense branching section from 110+ to 35 lines
- Merge 3 checklists into 1 unified Pre-Commit Checklist
- Remove duplicate ESLint/TS tables (now single merged table)
- Reduce total lines from 407 to 273 (-33%)
2025-12-18 01:43:58 -05:00
github-actions[bot] 26f45604ff chore(release): 6.2.1-dev.1 [skip ci] 2025-12-18 06:42:01 +00:00
Kai (Tam Nhu) TranandGitHub e222332e86 Merge pull request #130 from kaitranntt/kai/feat/session-persistence
feat(cliproxy): session persistence and dashboard status widget
2025-12-18 01:41:01 -05:00
kaitranntt 63bdc3ae39 fix(copilot): widen sidebar and balance split-view layout
- Increase sidebar width from w-64 to w-80 (320px)
- Increase model name truncation from 100px to 160px
- Balance config form split-view to 50%/50%
2025-12-18 01:38:02 -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 85cfbde5fd fix(dashboard): detect legacy proxy instances without session lock
Proxy status endpoint now falls back to port check when session tracker
has no data. Handles proxies started before session persistence feature.
2025-12-18 01:30:35 -05:00
kaitranntt 589cd2c2b7 feat(dashboard): add CLIProxy status widget with start button 2025-12-18 01:26:30 -05:00
semantic-release-bot a68aa26824 chore(release): 6.2.1 [skip ci]
## [6.2.1](https://github.com/kaitranntt/ccs/compare/v6.2.0...v6.2.1) (2025-12-18)

### Bug Fixes

* **ui:** add error state handling to API Profiles page ([2e77646](https://github.com/kaitranntt/ccs/commit/2e77646d607676fee1297948878cd4ba1939c58f)), closes [#125](https://github.com/kaitranntt/ccs/issues/125)
* **websearch:** pass through to native WebSearch for account profiles ([6bd1f42](https://github.com/kaitranntt/ccs/commit/6bd1f420d994e799125f338940689e969e524991))
2025-12-18 06:11:54 +00:00
Kai (Tam Nhu) TranandGitHub b1c7c459bb Merge pull request #128 from kaitranntt/dev
fix(release): v6.2.0-dev.2 - WebSearch native passthrough and UI improvements
2025-12-18 01:10:51 -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 a7450bdffe feat(cliproxy): default session persistence for CLIProxy
CLIProxy now persists by default after terminal closes:
- Spawn proxy with detached mode (survives terminal close)
- Remove auto-kill on Claude exit (proxy keeps running)
- Add `ccs cliproxy stop` to explicitly terminate proxy
- Add `ccs cliproxy status` to show running proxy info

Closes #129
2025-12-18 00:57:09 -05:00
github-actions[bot] 641dc4b67a chore(release): 6.2.0-dev.2 [skip ci] 2025-12-18 05:34:22 +00:00
Kai (Tam Nhu) TranandGitHub 7d03933f44 Merge pull request #127 from kaitranntt/kai/fix/websearch-hook-native-passthrough
fix(websearch): pass through to native WebSearch for account profiles
2025-12-18 00:33:19 -05:00
kaitranntt 6bd1f420d9 fix(websearch): pass through to native WebSearch for account profiles
WebSearch hook was blocking native Claude accounts (ccs ck, default)
with "No Providers Enabled" message instead of passing through to
server-side WebSearch.

Changes:
- Add shouldSkipHook() detection for account/default profile types
- Fix blocking bug: exit(0) when no providers enabled instead of blocking
- Pass CCS_PROFILE_TYPE and CCS_WEBSEARCH_SKIP env vars for profile-aware behavior
- Add profile type signals to settings, cliproxy, account, and default execution paths
2025-12-18 00:27:40 -05:00
github-actions[bot] 7b40929a78 chore(release): 6.2.0-dev.1 [skip ci] 2025-12-18 05:27:35 +00:00
Kai (Tam Nhu) TranandGitHub e4ee713d11 Merge pull request #126 from kaitranntt/kai/fix/api-profiles-empty-state
fix(ui): add error state handling to API Profiles page
2025-12-18 00:26:32 -05:00
kaitranntt 7886259c36 feat(copilot): redesign config form to match CLIProxy pattern
- Split-view layout (40% left / 60% right) matching CLIProxy design
- Left panel: Model Config tab with FlexibleModelSelector components,
  Settings tab, and Info tab
- Right panel: Raw JSON editor for copilot.settings.json
- Add preset buttons for quick model tier mapping
- Bidirectional sync between UI and raw JSON
- Simplify copilot.tsx page layout with narrower sidebar
2025-12-18 00:22:14 -05:00
kaitranntt 882792a4fb feat(copilot): add raw settings support to useCopilot hook
Add CopilotRawSettings interface and API functions for reading/writing
copilot.settings.json with conflict detection via expectedMtime.
2025-12-18 00:21:33 -05:00