mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-07 00:50:52 +00:00
Migrated aws-lightsail, e2b, gcp, lambda, and modal libraries to use the shared library pattern established in earlier refactoring rounds. Changes: - Added shared/common.sh sourcing block (local-first, remote-fallback) - Added bash safety flags (set -eo pipefail) to all 5 libraries - Removed duplicate provider-agnostic functions: - Logging (log_info, log_warn, log_error) - Input handling (safe_read) - OAuth flow (try_oauth_flow, get_openrouter_api_key_oauth) - SSH helpers (generate_ssh_key_if_missing, etc.) - Retained cloud-specific functions: - API wrappers and CLI integration - Server provisioning and lifecycle management - Cloud-specific validation and configuration Impact: - Net reduction: 460 lines (-545 added +85) - Eliminates code duplication across 5 providers - Improves consistency and maintainability - All libraries now follow the same architectural pattern Task: #3 (score 56 - highest priority) Also addresses Task #4 (bash safety flags) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| common.sh | ||