mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
Replace fly/lib/common.sh (741 lines of bash) with a TypeScript implementation using Bun runtime. The fly/ provider was the most complex bash code in the project — recent fixes (#1597, #1599, #1600) highlight the pain of debugging HTTP calls, JSON parsing, and multi-step auth flows in shell. New TypeScript modules: - fly/lib/ui.ts — logging, prompts, validation (zero deps) - fly/lib/fly.ts — API client (fetch), auth chain, org listing, provisioning - fly/lib/oauth.ts — OpenRouter OAuth via Bun.serve(), key management - fly/lib/agents.ts — typed agent configs for all 6 agents - fly/main.ts — orchestrator entry point Agent .sh files become thin shims (~30 lines) that install bun if needed, download TS sources for curl|bash execution, and delegate to main.ts. Test coverage: - 44 TypeScript unit tests (bun test) for pure logic - 4 fly failure-mode tests (mock.sh) for error scenarios - All existing test suites pass (110 run.sh, 76 mock.sh) Co-authored-by: lab <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| fixtures | ||
| e2e.sh | ||
| macos-compat.sh | ||
| mock-curl-script.sh | ||
| mock.sh | ||
| qa-dry-run.sh | ||
| record.sh | ||
| run.sh | ||
| test-sandbox.sh | ||
| update-readme.py | ||