Pluggable LLM code generation with typecheck-and-retry
- LLM provider interface (src/llm/provider.ts)
- Anthropic (Claude) and OpenAI (GPT) providers
- Auto-detection: ANTHROPIC_API_KEY > OPENAI_API_KEY
- Preference saved in .phoenix/config.json
- Override with PHOENIX_LLM_PROVIDER env var
Regen engine now has two modes:
- Stub mode (no LLM): typed skeletons with throw stubs
- LLM mode: sends IU contract + canonical requirements to LLM,
gets back real implementations
Typecheck-and-retry loop:
- After generating code, runs tsc --noEmit on the file
- If errors, feeds them back to the LLM for fix (up to 2 retries)
- Falls back to stubs if LLM fails entirely
CLI changes:
- bootstrap/regen show provider info
- phoenix regen --stubs forces stub mode
- Progress indicators for LLM generation
Tests: 201 passing (updated for async generateIU/generateAll)