Spaces:
Paused
Paused
Commit History
-
refactor(credentials): 🔨 separate view and manage credential menus
MirrowelThis commit refactors the credential management interface by separating view-only and management operations into distinct menus, improving user experience and code organization. - Add new `view_credentials_menu()` function that provides read-only credential viewing with drill-down capability from summary to provider-specific details - Create dedicated detail view functions `_view_api_keys_detail()` and `_view_oauth_credentials_detail()` for displaying comprehensive credential information - Modify `manage_credentials_submenu()` to focus solely on management operations (delete, edit) - Enhance `clear_screen()` function to accept an optional subtitle parameter, providing contextual headers throughout the application - Update all credential-related functions to use the new `clear_screen()` signature with descriptive subtitles for better navigation clarity - Add "View Credentials" as option 4 and "Manage Credentials" as option 5 in main menu - Improve visual hierarchy in detail views with …ef8f78e -
feat(credentials): ✨ add comprehensive credential management interface
MirrowelImplement a new credential management submenu that provides a unified view and control panel for all credentials (API keys and OAuth). This significantly improves the user experience for managing credentials across all providers. Key additions: - New credentials summary dashboard displaying API keys and OAuth credentials side-by-side with tier breakdowns - Delete functionality for both API keys and OAuth credentials with safety confirmations - Edit capability for OAuth credential email fields (particularly useful for Qwen Code) - Tier counting and display for OAuth providers that support tier information - Numeric sorting for API keys (properly handles KEY_1, KEY_10, etc.) - Safety mechanisms for API key deletion with backup/restore on unexpected changes - Improved visual presentation using Rich tables and columns The credential tool now provides complete CRUD operations for all credential types through an intuitive menu system, with proper error handling and user confirmations for d…8eb4988
-
refactor(core): 🔨 centralize path management for PyInstaller compatibility
MirrowelIntroduce a new `paths.py` utility module that provides centralized path resolution for all data files (logs, cache, OAuth credentials, usage data) with support for both PyInstaller EXE and script/library runtime modes. - Add `get_default_root()` to auto-detect EXE directory when frozen, otherwise uses CWD - Add `get_logs_dir()`, `get_cache_dir()`, `get_oauth_dir()`, and `get_data_file()` helpers - Update `RotatingClient` to accept optional `data_dir` parameter for override capability - Refactor all hardcoded path calculations to use centralized utilities - Update `CredentialManager` to accept `oauth_dir` parameter - Convert `failure_logger` to lazy initialization with configurable logs directory - Migrate `UsageManager` to accept optional `file_path` with automatic defaults - Update all provider-specific logging directories to use centralized helpers - Refactor credential tool and settings tool to use path utilities - Update main.py to load .env files from correct root directory in b…467f294
-
refactor(auth): 🔨 consolidate OAuth credential management into base classes
MirrowelThis commit refactors the OAuth credential setup and export functionality by moving all credential management logic from the credential_tool into the provider auth base classes. This follows the established pattern where auth classes own their credential lifecycle. Key changes: - Moved setup_credential(), build_env_lines(), export_credential_to_env(), list_credentials(), and delete_credential() methods from credential_tool.py into google_oauth_base.py, qwen_auth_base.py, and iflow_auth_base.py - Introduced CredentialSetupResult dataclass for standardized return values from setup operations - Added _post_auth_discovery() hook in google_oauth_base.py, with implementations in gemini_auth_base.py and antigravity_auth_base.py to perform tier/project discovery immediately after OAuth authentication - Moved _discover_project_id() and _persist_project_metadata() from provider classes into their respective auth base classes (gemini_auth_base.py and antigravity_auth_base.py) - Simplified creden…f439788
-
Merge branch 'main' into Antigravity
MirrowelUnverified signature465cc5f
-
refactor(ui): replace console.clear with cross-platform clear_screen for legacy terminal support
MirrowelPort from Antigravity branch commit 1ce8eba8df8e5b5ed6df80f98ce7a6f5b07233ce Replaces Rich's console.clear() with a cross-platform clear_screen() helper function that uses native OS commands (cls on Windows, clear on Unix) instead of ANSI escape sequences. This fixes terminal clearing issues on legacy Windows conhost terminals that don't properly support ANSI clear sequences. Modified files: - src/proxy_app/launcher_tui.py (11 instances replaced + clear_screen function added) - src/proxy_app/settings_tool.py (3 instances replaced + clear_screen function added) - src/proxy_app/main.py (1 instance replaced) - src/rotator_library/credential_tool.py (3 instances replaced) Improves compatibility with classic Windows Command Prompt while maintaining full functionality on modern terminals (Windows Terminal, Linux, macOS). This is a partial port containing only the terminal clearing improvements from the original commit. Other changes (provider file removal, credential tool enhancements) w…aa878c2 -
refactor(ui): 🔨 replace console.clear with cross-platform clear_screen function
MirrowelReplaced all instances of `console.clear()` with a new `clear_screen()` helper function that uses native OS commands (`cls` for Windows, `clear` for Unix-like systems) instead of ANSI escape sequences. - Adds `clear_screen()` function to launcher_tui.py, settings_tool.py, and credential_tool.py - Replaces 18 instances of `console.clear()` across the codebase - Improves terminal clearing reliability on classic Windows conhost and modern terminals (Windows Terminal, Linux, Mac) - Removes unused anthropic_provider.py and bedrock_provider.py files - Enhances credential_tool API key setup with better provider filtering logic to prevent duplicates - Adds debug mode to show environment variable names in credential tool1ce8eba
-
feat(credentials): ✨ add support for environment-based credential loading and bulk export tools
MirrowelThis commit introduces comprehensive support for loading OAuth credentials from environment variables alongside file-based credentials, and adds powerful bulk export/combine functionality for all credential types. Main changes: - **Environment-based credentials**: Modified main.py to load all *.env files from the root directory, enabling credentials to be stored in environment variables with an "env://" virtual path scheme - **Safe metadata handling**: Added checks throughout to skip file I/O operations for env-based credentials (they use virtual paths and don't have metadata files) - **Optimized credential discovery**: Updated RotatingClient to accept pre-discovered credentials from main.py, avoiding redundant discovery calls - **Bulk export tools**: Added `export_all_provider_credentials()` to export all credentials for a specific provider to individual .env files - **Credential combining**: Added `combine_provider_credentials()` to merge all credentials for a provider into a singl…bd8f638 -
feat(auth): ✨ add environment variable-based OAuth credential support with multi-account capability
MirrowelIntroduces a comprehensive environment variable-based credential system for stateless deployments, enabling multiple OAuth accounts per provider without requiring credential files. Key changes: - Add env-based credential discovery in CredentialManager with priority over file-based credentials - Implement numbered credential format (PROVIDER_N_ACCESS_TOKEN) supporting multiple accounts per provider - Support legacy single-credential format (PROVIDER_ACCESS_TOKEN) for backwards compatibility - Introduce virtual path system (env://provider/index) for env-based credentials - Update credential export tool to generate numbered .env files with merge instructions - Extend env credential support across all OAuth providers (Google OAuth, Antigravity, iFlow, Qwen Code) - Add Windows launcher script (launcher.bat) with interactive menu system for proxy configuration The numbered format allows combining multiple credentials in a single .env file: - ANTIGRAVITY_1_ACCESS_TOKEN, ANTIGRAVITY_1_REFRE…5bc49f2 -
refactor(credential-tool): 🔨 add export submenu for credential management
MirrowelIntroduced a new submenu for exporting credentials to .env format to improve user experience and code organization. - Add `export_credentials_submenu()` function to consolidate all export options - Implement `export_antigravity_to_env()` for Antigravity credential export - Refactor main menu to replace individual export options (3, 4, 5) with single "Export Credentials" option - Maintain consistent UI/UX patterns across all export functions - Generate .env files with metadata headers and timestamp information This change improves menu navigation by reducing clutter in the main menu and grouping related export functionality together.7830a78
-
feat(auth): extract GoogleOAuthBase and add antigravity provider
Mirrowel- Add providers/google_oauth_base.py to centralize Google OAuth logic (auth flow, token refresh, env loading, atomic saves, backoff/retry, queueing, headless support, and validation). - Migrate GeminiAuthBase and AntigravityAuthBase to inherit from GoogleOAuthBase and expose provider-specific constants (CLIENT_ID, CLIENT_SECRET, OAUTH_SCOPES, ENV_PREFIX, CALLBACK_PORT, CALLBACK_PATH). - Register "antigravity" in DEFAULT_OAUTH_DIRS and mark it as OAuth-only in credential_tool; include a user-friendly display name for interactive flows. - Remove large duplicated OAuth implementations from provider-specific files and consolidate behavior to reduce maintenance surface and ensure consistent token handling.97f1950
-
feat(auth): improve credential tool startup UX and lazy-load providers
Mirrowel- Defer heavy provider imports via a new _ensure_providers_loaded() helper to avoid the 6-7s blank startup wait and load providers lazily. - Enhance launcher TUI to show a full loading UI with spinner, header, elapsed time and provider count; call run_credential_tool(from_launcher=True) to avoid duplicate loading screens. - Add from_launcher flag to run_credential_tool and clear_on_start parameter to main() so standalone vs launcher flows behave correctly. - Swap direct provider_factory and PROVIDER_PLUGINS usage to go through the lazy loader in credential tool and callers. - Improve interactive UX: preserve/clear screen appropriately, add short pauses and prompts after flows, and keep console status messages during initialization. - Fix output formatting in qwen/iflow providers (replace escaped newlines with actual newlines) and enhance headless detection to log and print user-visible guidance when running without a GUI.2b065a1 -
feat(auth): ✨ add headless detection, re-auth on invalid refresh tokens, and persist gemini project/tier metadata
Mirrowel- add src/rotator_library/utils/headless_detection.py and export via utils __init__ to detect CI/SSH/container/headless sessions - use headless detection in Gemini/Qwen/iFlow auth flows to present appropriate instructions and avoid attempting to open a browser when no GUI is available - handle 401/403 refresh errors by triggering re-authentication flow (set needs_reauth, call initialize_token) instead of silently failing; improve logging around invalid grants - add GEMINI_CLI_TIER support: read/write tier into _proxy_metadata, include tier when exporting .env, cache tier info and persist project_id/tier to credential files via _persist_project_metadata - add mixed-tier detection and warning (_check_mixed_tier_warning) to surface potential free/paid credential conflicts - non-fatal persistence failures are logged to avoid startup regressions9756075
-
feat(auth): add interactive onboarding and credential setup with warnings
Mirrowel- add first-time onboarding checks in proxy_app/main.py to detect missing .env or PROXY_API_KEY and display a clear rich-powered onboarding message - auto-launch the credential setup tool (ensure_env_defaults + run_credential_tool) and reload environment vars, with validation to prevent starting without PROXY_API_KEY - add runtime warning when no provider credentials are configured so the proxy can start but not serve LLM requests - change RotatingClient to log a warning instead of raising when no API keys or OAuth credentials are provided - clear the console when the credential tool starts and exits for a cleaner interactive experience34e560e
-
feat(setup): ensure proxy key validation runs after credential creation
MirrowelDelay mandatory PROXY_API_KEY validation until the server runtime block to facilitate initial environment setup. This adjustment allows the application to proceed with the `--add-credential` flow even if the proxy key is initially unset: - Imports and runs `ensure_env_defaults()` to generate missing keys or files. - Reloads environment variables (dotenv) immediately after generation. - Validates the PROXY_API_KEY only before starting uvicorn. Also adds support for CHUTES_API_KEY in the credential tool.2c9c7d5
-
feat(auth): enable Qwen and iFlow credential export and dynamic model discovery
Mirrowelintroduce credential export functionality for Qwen Code and iFlow providers via the CLI, allowing users to easily generate deployment-ready .env files from stored OAuth credentials. This commit also implements dynamic model discovery for gemini_cli, iflow, and qwen_code providers. The model fetching logic now merges models from: - Environment variables - API endpoint discovery - Hardcoded fallback lists Additionally, improve the interactive OAuth setup experience by using human-readable display names in console output and logging instead of raw filenames.dea215f -
feat(auth): enable Gemini CLI stateless authentication via environment variables
MirrowelImplement support for loading Gemini CLI credentials directly from environment variables (e.g., GEMINI_CLI_ACCESS_TOKEN) for stateless hosting environments. The credential management tool (`credential_tool.py`) now includes a new option to export existing file-based Gemini OAuth credentials into a standard .env file format, simplifying setup for platforms without persistent storage. - Provider logic is updated to prioritize loading credentials from environment variables over local files. - Prevents saving newly refreshed access tokens back to the file system when the credentials originated from environment variables. - Updates README documentation detailing the new tool option and required environment variables. - Adds `time` import and `Accept` header for robustness.ea15798 -
feat(auth): enable API key fallback for Qwen Code and iFlow providers
MirrowelThis change refactors the core authentication structure for `qwen_code` and `iflow` to support both traditional API keys and OAuth credentials. This allows these providers to function effectively in both local and non-interactive environments. Provider classes were updated to handle credential identifiers dynamically: - `get_api_details` now detects whether the identifier is an OAuth file path or a raw API key string. - `proactively_refresh` correctly skips refresh attempts when a direct API key is used. Credential setup UX improvements: - The setup CLI now detects API keys with matching values and overwrites the existing variable to prevent environment file duplication. - Duplicate OAuth credentials (based on user email) are now overwritten in-place rather than aborting the setup process.0132663 -
feat(auth): introduce iFlow provider integration via OAuth
MirrowelImplement full integration for iFlow, supporting automatic credential discovery and management using the OAuth 2.0 authorization code flow. - Added `IFlowAuthBase` to handle the interactive OAuth flow and token refresh using a local `aiohttp` callback server. - Enabled automatic discovery of iFlow credentials from the standard `~/.iflow/` directory. - Ensures the dedicated API key (derived from user info after OAuth) is always used for API calls and refreshed proactively. - Updated `requirements.txt` to include `aiohttp` for the local server functionality. - Refactored Qwen providers to clean tool schemas and standardize streaming assembly logic for better robustness.5ee03d6
-
feat(auth): add interactive API key setup supporting 70+ providers
MirrowelRefactors the credential setup utility to integrate support for standard API keys alongside existing OAuth providers. Key changes: - The main menu is updated to allow selection between OAuth credential setup and API key setup. - Implements `setup_api_key` to interactively guide the user through selecting from a list of recognized LiteLLM providers. - API keys are automatically saved to the project's `.env` file, utilizing key indexing (e.g., `OPENAI_API_KEY_1`) to support multiple keys per provider. - Introduces `ensure_env_defaults` to automatically initialize the `.env` file and set essential default values like `PROXY_API_KEY`.e8d627c -
feat(auth): introduce dedicated --add-credential CLI utility
MirrowelThis change implements a new interactive utility that streamlines the process of adding new OAuth credentials for supported providers. - The main application now accepts the `--add-credential` flag to run the setup tool instead of starting the proxy server. - Adds `src/rotator_library/credential_tool.py` which leverages the new `rich` dependency for a better console experience and clear interactive prompts. - The tool automatically handles token initialization, fetches user identification, and manages the saving of unique credential files to prevent duplication. - Includes the `add_oauth_credential.bat` script for easy launch on Windows.2e16e7e