Add authenticated cmux Sprites workflow
Adds a standalone cmux-sprites Go CLI with Stack device-code login, backend-owned Fly credentials, Sprite lifecycle commands, and automatic cmux Noise enrollment. Login always prints a copy-paste URL and code; opening the browser is opt-in.
Adds the Sprites Cloud VM provider, pinned cmux@0.9.11 bootstrap, persistent cmux daemon service, checkpoint support, provider migrations, localized approval copy, and focused tests. The provider bootstraps normal Sprites because Fly does not publicly document cross-Sprite checkpoint forks in its REST API or SDK.
Verified with Go test/vet/build, web typecheck, ESLint, schema check, focused API/provider tests, a real Stack approval, and create/list/exec/connect/destroy against Fly Sprites. The exact TUI connection reached the Sprite shell and returned CMUX_SPRITES_CONNECT_OK.
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Adds a new cmux-sprites CLI and a Sprites VM provider to create, connect to, and manage Fly Sprites via Stack device‑code login. The workflow keeps Fly credentials on the server, enforces strict enrollment deadlines, and supports secure local HTTPS development.
-
New Features
cmux-spritesGo CLI with device-code login (client:cmux-sprites) and commands:login,logout,status,create,list,exec,connect,destroy. Blocks cross-origin API redirects; credentialed calls require HTTPS. OptionalCMUX_SPRITES_CA_FILEadds a custom CA while preserving the default HTTP transport.connectauto-enrolls this device: creates a 5‑minute invite, launchescmux connect, and auto-approves only after the device claims the invite, with cancellation-aware retries and a strict approval deadline.- Sprites provider using
@fly/sprites: creates a Sprite, installs pinnedcmux@0.9.11, starts a persistentcmux daemon, and returnsconnectionUrl. VM list/create includeconnectionUrland setcache-control: no-store. - Checkpoints (snapshots) are supported; cross‑Sprite restore is disabled until Fly publishes a fork API.
- Hardened API errors: hide provider messages and return only safe error codes.
-
Migration
- Run DB migrations to add the
spritesprovider and allow thecmux-spritesauth client. - Configure env:
CMUX_VM_SPRITES_ENABLED=true,SPRITE_TOKEN(server-only Fly token), optionalSPRITES_API_URL,CMUX_SPRITES_NPM_SPEC, and optional CLICMUX_SPRITES_CA_FILEto trust a local TLS proxy for dev. - Ensure the web app installs
@fly/sprites@0.1.0and includes the new image manifest entry. No changes needed for existing providers.
- Run DB migrations to add the
Summary by CodeRabbit
-
New Features
- Added the
cmux-spritesCLI for authentication, Sprite management, command execution, and device enrollment. - Added Sprites as a Cloud VM provider with lifecycle management, snapshots, status, and connection URLs.
- Added device-code authorization, secure credential handling, localized approval screens, and configurable provider support.
- Added the
-
Documentation
- Documented CLI usage, authentication, security, configuration, and provider limitations.
-
Bug Fixes
- Improved response caching and prevented internal provider error details from being exposed.
-
Tests
- Added coverage for authentication, enrollment, provider validation, security, lifecycle, and connection behavior.