8 Commits

  • **feat(auth, executor, cmd): add Antigravity provider integration**
    - Implemented OAuth login flow for the Antigravity provider in `auth/antigravity.go`.
    - Added `AntigravityExecutor` for handling requests and streaming via Antigravity APIs.
    - Created `antigravity_login.go` command for triggering Antigravity authentication.
    - Introduced OpenAI-to-Antigravity translation logic in `translator/antigravity/openai/chat-completions`.
    
    **refactor(translator, executor): update Gemini CLI response translation and add Antigravity payload customization**
    
    - Renamed Gemini CLI translation methods to align with response handling (`ConvertGeminiCliResponseToGemini` and `ConvertGeminiCliResponseToGeminiNonStream`).
    - Updated `init.go` to reflect these method changes.
    - Introduced `geminiToAntigravity` function to embed metadata (`model`, `userAgent`, `project`, etc.) into Antigravity payloads.
    - Added random project, request, and session ID generators for enhanced tracking.
    - Streamlined `buildRequest` to use `geminiToAntigravity` transformation before request execution.
  • feat(translators): add token counting support for Claude and Gemini responses
    - Implemented `TokenCount` transform method across translators to calculate token usage.
    - Integrated token counting logic into executor pipelines for Claude, Gemini, and CLI translators.
    - Added corresponding API endpoints and handlers (`/messages/count_tokens`) for token usage retrieval.
    - Enhanced translation registry to support `TokenCount` functionality alongside existing response types.
  • refactor: standardize constant naming and improve file-based auth handling
    - Renamed constants from uppercase to CamelCase for consistency.
    - Replaced redundant file-based auth handling logic with the new `util.CountAuthFiles` helper.
    - Fixed various error-handling inconsistencies and enhanced robustness in file operations.
    - Streamlined auth client reload logic in server and watcher components.
    - Applied minor code readability improvements across multiple packages.
  • Update internal module imports to use v5 package path
    - Updated all `github.com/luispater/CLIProxyAPI/internal/...` imports to point to `github.com/luispater/CLIProxyAPI/v5/internal/...`.
    - Adjusted `go.mod` to specify `module github.com/luispater/CLIProxyAPI/v5`.