Commit Graph

8 Commits

  • feat(claude-executor): add ZSTD decoding support for Claude executor responses
    - Integrated ZSTD decompression via `github.com/klauspost/compress` for responses with "zstd" content-encoding.
    - Added helper `hasZSTDEcoding` to detect ZSTD-encoded responses.
    - Updated response handling logic to initialize and use a ZSTD decoder when necessary.
    
    refactor(api-handlers): split streaming and non-streaming response handling
    
    - Introduced `handleNonStreamingResponse` for processing non-streaming requests in `ClaudeCodeAPIHandler`.
    - Improved code clarity by separating streaming and non-streaming logic.
    
    fix(service): remove redundant token refresh interval assignment logic in `cliproxy` service.
  • feat(logging): integrate logrus with custom Gin middleware for enhanced request logging and recovery
    - Added `GinLogrusLogger` for structured request logging using Logrus.
    - Implemented `GinLogrusRecovery` to handle panics and log stack traces.
    - Configured log rotation using Lumberjack for efficient log management.
    - Replaced Gin's default logger and recovery middleware with the custom implementations.
  • 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`.
  • Refactor translator packages for OpenAI Chat Completions
    - Renamed `openai` packages to `chat_completions` across translator modules.
    - Introduced `openai_responses_handlers` with handlers for `/v1/models` and OpenAI-compatible chat completions endpoints.
    - Updated constants and registry identifiers for OpenAI response type.
    - Simplified request/response conversions and added detailed retry/error handling.
    - Added `golang.org/x/crypto` for additional cryptographic functions.
  • Add file watcher for dynamic configuration and client reloading
    - Introduced `Watcher` for monitoring updates to the configuration file and authentication directory.
    - Integrated file watching into `StartService` to handle dynamic changes without restarting.
    - Enhanced API server and handlers to support client and configuration updates.
    - Updated `.gitignore` to include `docs/` directory.
    - Modified go dependencies to include `fsnotify` for the file watcher.