# TOOLS.md - Echo

## Unelte principale

### Email
- **Trimitere:** `python3 tools/email_send.py "dest" "subiect" "corp"`
- **Procesare:** `python3 tools/email_process.py [--save|--all]`
- **From:** Echo <mmarius28@gmail.com> | **Reply-To:** echo@romfast.ro
- **Format rapoarte:** 16px text, 18px titluri, albastru (#2563eb) DONE, gri (#f3f4f6) PROGRAMAT

### Dashboard
- **URL:** https://moltbot.tailf7372d.ts.net/echo/
- **Issues:** Editez direct `dashboard/issues.json`
- **Notes:** /echo/notes.html | **Files:** /echo/files.html | **Habits:** /echo/habits.html

### Git
- **Repo:** gitea.romfast.ro/romfast/clawd
- `python3 tools/git_commit.py --push`

### Calendar
- **Credentials:** credentials/google-calendar.json + google-calendar-token.json
- **Moduri:** `python3 tools/calendar_check.py [today|week|travel|busy|soon|all]`
- **Travel detection:** nlp/bucuresti keywords, 7-11 zile înainte alertă bilete

### KB
- **Folder:** memory/kb/ (youtube/, coaching/, insights/, projects/)
- **Update:** `python3 tools/update_notes_index.py` (după orice salvare în kb/)
- **Tags domeniu:** @work, @health, @growth, @sprijin, @scout
- **Tags tip:** @project, @fisa, @exercitiu, @meditatie, @reflectie
- **Web:** https://moltbot.tailf7372d.ts.net/echo/notes.html

### Memory Search
- `memory_search query="text"` → caută semantic în memory/
- `memory_get path="..." from=N lines=M` → extrage snippet
- **Index:** ~/.clawdbot/memory/echo.sqlite (Ollama all-minilm embeddings)

### ANAF Monitor
- **Script:** `python3 tools/anaf-monitor/monitor_v2.py` (v2.2)
- **Funcții:** Hash detection, version extraction, diff, snapshots
- **Job:** daily-morning-checks (03:00 București)

### Procesare Bonuri
- **Script:** `python3 tools/process_bon.py <pdf> [--save]`
- **Flux:** Dry run → confirmare → --save (Oracle + SQLite)

### YouTube Subtitles
- **Script:** `python3 tools/youtube_subs.py URL [lang]`
- **Output:** titlu + transcript text (subtitrări clean)

### Whisper
- **Venv:** ~/clawd/venv/ | **Model:** base
- **Utilizare:** `whisper.load_model('base').transcribe(path, language='ro')`

### Pauze respirație
- **Script:** `python3 tools/pauza_random.py`
- **Bancă:** memory/kb/tehnici-pauza.md
- **Format:** **Nume** → pași → 📊 Rezultat → 📚 Sursă
- **Flux actualizare:** Automat via daily-morning-checks (insights-extract component)

### Ralph Workflow (Autonomous Code Generation)
- **Generator PRD:** `python3 tools/ralph_prd_generator.py` - Generează PRD și prd.json în Python
- **Wrapper:** `python3 tools/ralph_workflow.py` - Lansare completă (PRD + Ralph)
- **Loop autonom:** `ralph.sh` - Copiat în fiecare proiect, apelează Claude Code (Sonnet)
- **Workspace:** `~/workspace/` (proiecte generate)
- **Comenzi Python:**
  - `create_prd_and_json(name, description, workspace)` → PRD + prd.json
  - `run_ralph(prd_json, max_iter, bg)` → lansare loop autonom
  - `check_status(project_dir)` → progres stories
- **Model strategy:** Opus (PRD/stories) → Sonnet (implementare)
- **Doc:** `memory/kb/tools/ralph-workflow.md`

## Cron Jobs

**Principale:** 
- heartbeat-2h (la 2h, 07-23) - verificări periodice email/calendar/git
- daily-morning-checks (03:00) - JOB UNIFICAT: night-execute + security-audit + self-audit + anaf-monitor + insights-extract
- morning-report (08:30), morning-coaching (09:00)
- respiratie-orar (09-19)
- evening-report (20:00), evening-coaching (21:00)
- night-execute (23:00) - execută proiecte/features (run 1)

**Secundare:** content-discovery (02:00), archive-tasks (05:00), weekly-planning (21:00 dum), antfarm agents (6 jobs, la 2 min)

**Lista completă:** memory/kb/tools/cron-jobs.md
**Comenzi:** `cron action=list|run|update jobId=X`

## Infrastructură

**Proxmox:** 3 noduri (pveelite .202, pvemini .201, pve1 .200) | **User:** echo
**Docker:** LXC 100 - 10.0.20.170:9443 (portainer)
**Ollama:** LXC 104 - 10.0.20.161:11434 (all-minilm embeddings)
**Detalii:** memory/kb/tools/infrastructure.md

### Content Discovery
- **Script:** `python3 tools/content_discovery.py`
- **Utilizare:** Căutare automată de conținut bazată pe interese (YouTube, articole)
- **Job:** content-discovery (02:00 București)

### Email Check
- **Script:** `python3 tools/email_check.py`
- **Utilizare:** IMAP inbox checker pentru moltbot@romfast.ro, returnează emailuri necitite ca JSON

### Generate PDF
- **Script:** `python3 tools/generate_pdf.py`
- **Utilizare:** Generează PDF din markdown content (output binary la stdout)

### Calendar Auth
- **Script:** `python3 tools/calendar_auth.py`
- **Utilizare:** OAuth2 authorization one-time setup pentru Google Calendar token

## Unelte per domeniu

### Sprijin (grup joi)
- Proiect: `memory/kb/projects/grup-sprijin/`
- Biblioteca: `biblioteca.json` | Fișe: `fise/`

### Self
- Ritual: 08:00 și 23:00 coaching
- Tehnici: CNV, NLP, Sleight of Mouth
