Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ venv/
# Backup files
*.backup

# Planning docs (local only)
SANTADER-IA/

# Misc
*.pem
68 changes: 32 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AI-powered code analysis and automatic code fixing tool that combines **ESLint**
- **Code editor** with support for TypeScript, TSX, JavaScript, and Python
- **ESLint analysis** for JavaScript/TypeScript with automatic fixes
- **Ruff analysis** for Python with automatic fixes
- **AI model selector** — elige proveedor desde la UI (Auto, Ollama, Gemini, Claude)
- **AI model selector** — choose provider from the UI (Auto, Ollama, Gemini, Claude)
- **Multi-provider AI** (Ollama, Gemini, Claude, Grok) for intelligent suggestions
- **llm_bridge microservice** (Python) as unified AI backend
- **Preview changes** before applying corrections
Expand All @@ -17,7 +17,7 @@ AI-powered code analysis and automatic code fixing tool that combines **ESLint**
- **Direct navigation** from errors to code lines
- **Responsive** for desktop and mobile
- **Demo/Mock mode** when no AI provider is available
- **Provider error feedback** — mensajes claros si falla un proveedor (key inválida, servidor caído, etc.)
- **Provider error feedback** — clear messages when a provider fails (invalid key, server down, etc.)
- **Backend Python tests** (pytest) + Frontend tests (Jest)

## Requirements
Expand All @@ -32,9 +32,12 @@ AI-powered code analysis and automatic code fixing tool that combines **ESLint**

```bash
cd backend
cp .env.example .env # Create config file
python -m venv venv
source venv/Scripts/activate # Windows: venv\Scripts\activate
source venv/Scripts/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install ruff # Python linter
# Edit .env and add your API keys
python app.py
```

Expand Down Expand Up @@ -62,15 +65,12 @@ cd frontend && npm run dev

### 4. Configure API Keys (optional)

- **Gemini**: Create a free API key at https://aistudio.google.com/apikey
- **Claude**: Set `ANTHROPIC_API_KEY` in `backend/.env`
- **Ollama**: No key needed (local), run `ollama pull qwen2.5-coder:1.5b`

Edit `backend/.env` and `frontend/.env.local`:
API keys only go in `backend/.env`. Copy from `.env.example` and fill in:

```env
GEMINI_API_KEY=tu_key_aqui
```
- **Gemini**: `GOOGLE_AI_STUDIO_API_KEY` — get a free key at https://aistudio.google.com/apikey
- **Claude**: `ANTHROPIC_API_KEY` — requires a paid Anthropic account
- **Grok**: `XAI_API_KEY` — requires an xAI account
- **Ollama**: No key needed (local), run `ollama pull qwen2.5-coder:1.5b`

## Architecture

Expand Down Expand Up @@ -124,13 +124,13 @@ GEMINI_API_KEY=tu_key_aqui

### Auth & Error Messages

| Provider | How to configure | Si falla, muestra |
|----------|-----------------|-------------------|
| Provider | How to configure | Error message |
|----------|-----------------|---------------|
| **Mock** | None | — |
| **Ollama** | `ollama pull qwen2.5-coder:1.5b` | "Ollama: servidor no disponible. ¿Está corriendo?" |
| **Gemini** | `GEMINI_API_KEY` en `.env` | "Gemini: API key inválida. Conseguí una gratis en https://aistudio.google.com/apikey" |
| **Claude** | `ANTHROPIC_API_KEY` en `.env` | "Claude: API key no configurada o inválida" |
| **Grok** | `XAI_API_KEY` en `.env` | "Grok: API key no configurada o inválida" |
| **Ollama** | `ollama pull qwen2.5-coder:1.5b` | "Ollama: server not available. Is it running?" |
| **Gemini** | `GEMINI_API_KEY` in `.env` | "Gemini: invalid API key. Get a free one at https://aistudio.google.com/apikey" |
| **Claude** | `ANTHROPIC_API_KEY` in `.env` | "Claude: API key not configured or invalid" |
| **Grok** | `XAI_API_KEY` in `.env` | "Grok: API key not configured or invalid" |

### Default models

Expand All @@ -141,12 +141,12 @@ GEMINI_API_KEY=tu_key_aqui
| Claude | `claude-sonnet-4-20250514` |
| Grok | `grok-3-mini-fast-latest` |

### Error scenarios detectadas
### Detected error scenarios

- API key inválida o vencidamensaje claro con link para obtener key gratis
- Servidor no disponible (Ollama caído) → mensaje de conexión
- Cuota agotada (rate limit) → mensaje de espera
- Autenticación fallidamensaje de revisar key
- Invalid or expired API keyclear message with link to get a free key
- Server unavailable (Ollama down) → connection error message
- Quota exhausted (rate limit) → wait and retry message
- Authentication failedcheck your key message

## Linting

Expand Down Expand Up @@ -183,32 +183,28 @@ CodeMp-AI/
│ │ └── DemoBanner.tsx # Provider error/demo banner
│ ├── __tests__/ # Jest tests
│ └── package.json # Uses --webpack flag
├── SANTADER-IA/
│ ├── 04_PLAN_ACCION_AGENTE.md
│ └── 06_PLAN_COLABORACION_SANTANDER.md
├── .github/workflows/ci.yml
└── README.md
```

## What remains to test

- [ ] Obtener una API key de Gemini válida y probar flujo completo con Gemini
- [ ] Probar Ollama local con `ollama pull qwen2.5-coder:1.5b` y verificar que Apply Fix funcione
- [ ] Configurar `ANTHROPIC_API_KEY` y probar Claude
- [ ] Probar modo "Auto" fallback (ej: Ollama caído → Gemini → Claude)
- [ ] Verificar que el export de reportes funcione con providers reales (no solo demo)
- [ ] Probar en mobile (responsive)
- [ ] Verificar que el hot-reload de Webpack funciona correctamente
- [ ] Test Ollama locally with `ollama pull qwen2.5-coder:1.5b` and verify Apply Fix works
- [ ] Configure `ANTHROPIC_API_KEY` and test Claude
- [ ] Configure `XAI_API_KEY` and test Grok
- [ ] Test "Auto" fallback mode (e.g. Ollama down → Gemini → Claude)
- [ ] Verify report export works with real providers (not just demo)
- [ ] Test on mobile (responsive)

## Known Issues

- Turbopack requiere CPU con soporte BMI2 → se usa `--webpack` en el script `dev`
- Gemini API key actual (`[REDACTED]`) es inválida
- Ollama necesita `api_key='ollama'` dummy en el backend (solución implementada)
- Turbopack requires CPU with BMI2 support → the `dev` script uses `--webpack` by default
- Current Gemini API key has exhausted quota (resource_exhausted) — replace with a valid key in `.env`
- Ollama needs a dummy `api_key='ollama'` in the backend (workaround implemented)

## Technologies

- **Next.js 16** (con Webpack, no Turbopack)
- **Next.js 16** (with Webpack, not Turbopack)
- **TypeScript** + **Tailwind CSS**
- **CodeMirror 6** - Editor
- **ESLint 9** - JS/TS linting
Expand Down
145 changes: 0 additions & 145 deletions SANTADER-IA/01_informe_llm_bridge.md

This file was deleted.

Loading
Loading