Files
cc-switch/src-tauri
Jason 590be4e136 refactor(providers): add flexible app type resolution with dual parameter support
Add `resolve_app_type` helper to support both enum and string-based app type
parameters across all provider commands. This change:

- Eliminates implicit default to Claude (previously used `unwrap_or`)
- Supports two parameter forms: `app_type` (enum, priority 1) and `app` (string, priority 2)
- Provides explicit error handling when both parameters are missing
- Updates all 14 provider command functions with consistent parameter validation
- Fixes tray menu provider switching to pass the new `app` parameter

This dual-parameter approach maintains backward compatibility while enabling
future CLI tool integration and more flexible API usage patterns.

Technical details:
- Priority order: `app_type` enum > `app` string > error
- Invalid `app` strings now return errors instead of defaulting
- All existing tests pass (45/45)
2025-10-29 20:33:30 +08:00
..
2025-10-14 10:39:11 +08:00