mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-08 01:51:14 +00:00
Extracted helper functions to improve code maintainability: 1. shared/common.sh: - Extracted _prompt_and_validate_api_key() from get_openrouter_api_key_manual() - Simplified API key validation loop and confirmation logic 2. cli/commands.ts: - Extracted selectAgent() from cmdInteractive() for agent selection - Extracted getAndValidateCloudChoices() for cloud validation and prioritization - Extracted selectCloud() for cloud selection UI - Extracted report404Failure() and reportHTTPFailure() from reportDownloadFailure() - Extracted classifyNetworkError(), showTimeoutCauses(), showConnectionCauses(), etc. - Simplified error handling with switch statement in reportDownloadError() These changes reduce cyclomatic complexity and improve testability while preserving all existing functionality. Co-authored-by: spawn-refactor-bot <refactor@openrouter.ai> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| common.sh | ||
| github-auth.sh | ||
| key-request.sh | ||