Commit graph

23 commits

Author SHA1 Message Date
eric
8780c2b176 Fix task ordering (FIFO) + Telegram standup reply matching
- get_tasks(): ORDER BY id ASC (oldest first) for TaskBeat FIFO processing
- UI calls use order='desc' so display stays newest-first
- trigger_daily_standup(): standup sub-tasks now stored as type='standup_reply'
  with telegram_chat_id set correctly so replies can be matched
- telegram_message_handler: checks for open standup_reply task from same
  chat_id before creating new task - if found, marks standup complete and
  creates orchestrator follow-up task with full context to process the reply
- tasks.html: badge for standup_reply type
2026-02-21 20:22:39 +00:00
eric
003e591a04 Add daily standup + knowledge broadcast system
- DailyStandupBeat thread fires at 09:00 every day
- trigger_daily_standup(): messages all team members, orchestrator updates KB + agent reminders
- broadcast_knowledge_update(): distributes any new info to all agents immediately
- parse_agent_commands(): add <update_knowledge> and <update_agent_reminder> XML handlers
- /api/standup/trigger and /api/broadcast routes for manual triggering
- orchestrator systemprompt: standup + broadcast instructions with examples
- tasks.html: badges for standup / broadcast / action_knowledge task types
2026-02-21 19:46:42 +00:00
eric
d38ba10b5e fix: Use correct created_at field name in tasks template (was task.created) 2026-02-21 19:09:40 +00:00
eric
d3800ac792 feat: Log all agent actions (@SEND_EMAIL, @SEND_TELEGRAM, @ADD/UPDATE_TEAM_MEMBER) as tasks
Every parsed agent command now creates a task entry with type action_email /
action_telegram / action_team, parent_task_id pointing to the originating task,
and status completed/error reflecting the actual outcome.

Tasks UI gets matching badges for all new types plus a parent-task indicator
(↳ #N) so the full chain from trigger to action is visible at a glance.
2026-02-21 19:06:33 +00:00
eric
f6ad727bf0 feat: Persist outbound emails, fix @UPDATE_TEAM_MEMBER parser, add per-entry delete
- Add sent_emails table to DB for persistent outbox logging
- send_email() now writes every outgoing mail (incl. errors) to sent_emails
- parse_agent_commands() passes agent_key/task_id as triggered_by metadata
- Fix @UPDATE_TEAM_MEMBER parser: now matches Identifier/TelegramID/Role/etc.
  format from system prompt (was expecting Email/Field/Value — never matched)
- update_team_member() called correctly via **kwargs (was positional args bug)
- Set Piotr telegram_id=1578034974 directly in DB
- email_log.html: two-tab UI (Inbox Journal + Outbox), click-to-expand body
- emails.html: per-message delete button in inbox list
- New routes: DELETE inbox (IMAP expunge), journal entry, sent entry
2026-02-21 18:43:21 +00:00
eric
99df910497 feat: Add Telegram bot integration and task detail/delete UI
- Wire up Telegram bot with token, allowed users and username from .env
- Fix TaskBeat to handle direct tasks (Telegram/email) without sub_tasks
- Fix send_telegram_message to use run_coroutine_threadsafe (avoid event loop clash)
- Add TaskBeat watchdog thread for auto-restart on crash
- Reset stuck in_progress tasks on startup
- Add task detail page (/tasks/<id>) with full response/log view and auto-refresh
- Add task delete route (/tasks/delete/<id>) with confirmation
- Include agent sender info in Telegram task prompts
- Orchestrator self-updated knowledge base with Telegram contact info
2026-02-21 18:14:43 +00:00
eric
83b1842392 feat: Add password login system and upgrade agent models
- App-level password auth via Flask session (APP_PASSWORD in .env)
- login_required decorator on all routes
- Login page, logout button in navbar, 7-day session lifetime
- Upgrade musik_rechte_advisor and negotiator from Opus 4.0 to Opus 4.6
- Fix orchestrator session cookie overflow (kb/prompts no longer stored in session)
- Change app port from 5000 to 5050 (5000 occupied by Zou/Kitsu)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:26:10 +00:00
7ee66397e1 feat: Enhanced Orchestrator Chat with notifications and better UX
- Add task creation notifications in Orchestrator Chat
- New messages appear at top (newest first)
- Add Clear Chat button with confirmation
- Improve timestamps: DD.MM.YYYY HH:MM:SS format
- Support for system notifications (task created, sub-agent responses)
- Add add_orchestrator_notification() helper function
- Auto-notify when agents create sub-tasks
- Clear Chat route: POST /orchestrator/clear
- Better visual distinction between messages and notifications
2026-02-21 18:02:01 +01:00
e2a853ffde feat: Add live streaming to Chat page
- Replace blocking execute_agent_task() with live subprocess streaming
- Use Popen() to read opencode output line-by-line in real-time
- Send 'chunk' events to frontend as agent thinks
- Frontend appends chunks incrementally for live response
- Matches Orchestrator's streaming UX
- No more waiting for complete response before seeing output
2026-02-21 17:32:37 +01:00
d620f496a8 feat: Make footer app name dynamic
- Replace hardcoded 'Frankenbot' in footer with {{ app_name }}
- Footer now reflects custom app name from settings
- Consistent branding across navigation, title, and footer
2026-02-21 17:28:46 +01:00
b218d111b6 feat: Redesign Dark Mode with balanced purple theme
- Change Dark Mode accent from blue to purple (#a855f7)
- Balance dark backgrounds to match Light Mode structure
  - bg-base: #1a1a1a (was #0f0f0f - too dark)
  - bg-surface: #212121 (more balanced)
  - Improved contrast and readability
- Update borders to be more visible (12% vs 8% opacity)
- Adjust agent colors for purple theme:
  - Orchestrator: Purple
  - Researcher: Green
  - Negotiator: Orange
  - AR Manager: Yellow
- Update Settings description: 'Violett' instead of 'Blau'
- Dark Mode now mirrors Light Mode balance (just inverted)
2026-02-21 17:19:32 +01:00
85976afa09 fix: Use theme-aware code color in file modal
- Replace hardcoded #a5f3fc (bright blue) with var(--code-text)
- Now respects dark mode (#d4d4d4) and light mode (#404040)
- Fixes unreadable text in file preview modal
2026-02-21 17:14:06 +01:00
2a9941f35f feat: Material Icons, customizable app name & dark/light mode toggle
- Add Google Material Icons integration with smart_toy robot icon
- Implement app_settings database table for persistent configuration
- Add App Name customization in Settings (changes navigation & title)
- Add Dark/Light Mode theme switcher
  - Dark Mode: Lightened black (#0f0f0f) with blue accents (#0a84ff)
  - Light Mode: Clean white/gray with red accents (#ef4444)
- Create context_processor for global app_settings injection
- Redesign Settings page with new App Design section
- Optimize CSS: 724 additions, reduced complexity
- Remove outdated agent reminders (70 lines cleanup)
2026-02-21 16:59:18 +01:00
dc2ea07621 feat: Complete UX cleanup - Agent colors & streamlined navigation
Agent Color System:
- Added unique colors for each agent (orchestrator: purple, researcher: teal, negotiator: red, ar_manager: yellow)
- CSS variables and utility classes (.agent-*, .agent-badge-*, .agent-border-*)
- Tasks table now shows colored left border per agent
- Agent names displayed in their brand color

Navigation Simplification:
- Removed 'Email Log' from main menu (reduced clutter)
- Email Log now accessible via link in Emails page
- Active state for both /emails and /email-log on Emails nav item

Visual Improvements:
- Agent assignments now visually distinct at a glance
- Cleaner, more focused navigation menu
- Better information architecture
2026-02-21 15:06:32 +01:00
50c1a0315b feat: UX Cleanup & Critical TaskBeat Fix
UX Improvements:
- Tasks page: Remove 'Create new task' form (orchestrator handles all)
- Orchestrator: Simplified to single 'Prompt' section, removed 'Tasks verteilen'
- Orchestrator: Removed 'Klassisch senden' button (live-only responses)
- Orchestrator: Removed 'Aktive Agenten' display (redundant with dashboard)

Critical Fix:
- TaskBeat now reads pending tasks from DATABASE instead of in-memory array
- All status updates (pending→in_progress→completed) now persist to DB
- Fixes issue where tasks created via API/UI were not being processed
- Agent_key updates also synced to DB

This fixes the bug where Task #1 was stuck in pending status.
2026-02-21 15:04:22 +01:00
4ca5132391 feat: Add edit functionality for team members
- Edit modal with Bootstrap for inline editing
- Update name, email, role, responsibilities, telegram_id
- Form validation and error handling
- Success/error flash messages
- Team member data passed to frontend via JSON
2026-02-21 14:22:38 +01:00
0e02611c87 feat: Add Team-Members management page
- New /team route to view all team members
- Add/activate/deactivate team members via UI
- Display name, role, email, responsibilities, telegram_id
- Integrated into main navigation
- Self-learning system info displayed
2026-02-21 14:20:07 +01:00
11352d2ca5 feat: Files-Seite verbessert - View, Download & Delete für alle Dateitypen
UI Improvements:
- Agent Work Files: View-, Download- und Delete-Buttons hinzugefügt
- Projektdokumente: Download- und Delete-Buttons hinzugefügt
- Konsistentes UI über alle Datei-Kategorien
- View-Modal für Agent-Dateien (wie Projektdokumente)

Backend:
- /files/agent/<agent_key>/view/<filename> - Agent-Datei anzeigen
- /files/agent/<agent_key>/delete/<filename> - Agent-Datei löschen
- /files/agent/<agent_key>/<filename>?download=1 - Force Download
- /files/project/<filename>?download=1 - Projektdatei Download
- /files/project/delete/<filename> - Projektdatei löschen

Security:
- Path traversal protection für alle Routes
- Whitelist-basierte Dateityp-Validierung
- Agent-Zugriff nur auf eigene work-Verzeichnisse

Features:
- 👁 View: Datei im Modal anzeigen (Markdown, TXT)
- ↓ Download: Force download statt Browser-Ansicht
- ✕ Delete: Datei löschen mit Bestätigung
2026-02-21 13:25:37 +01:00
73c36785e2 feat: Telegram Bot Integration mit QR-Code
Features:
- Telegram Bot mit python-telegram-bot Library
- Bidirektionale Kommunikation (Anfragen → Tasks → Antworten)
- QR-Code auf Settings-Seite für einfache Bot-Verbindung
- User-ID Whitelist für Sicherheit
- Automatische Task-Erstellung aus Telegram-Nachrichten
- Agent-Antworten werden zurück zu Telegram gesendet

Implementation:
- Neue Telegram-Handler in app.py (start, message)
- QR-Code Generator mit qrcode Library
- Settings-Seite erweitert mit Telegram-Konfiguration
- .env.example mit Telegram-Setup-Anleitung
- Background Thread für Telegram Polling
- Integration mit bestehendem Task-System

Configuration:
- TELEGRAM_BOT_TOKEN: Bot Token von @BotFather
- TELEGRAM_BOT_USERNAME: Bot Username für QR-Code
- TELEGRAM_ALLOWED_USERS: Komma-getrennte User-IDs

Usage:
1. Bot via @BotFather erstellen
2. Token + User-IDs in .env eintragen
3. App starten
4. QR-Code auf /settings scannen
5. /start im Bot senden
2026-02-21 13:17:04 +01:00
ca820d20db fix: Code-Quality und Security-Verbesserungen
Security Fixes:
- Fix XSS vulnerability in orchestrator.html (escapeHtml für user input)
- Verbesserte Error-Handling: 4 bare except clauses mit spezifischen Exception-Typen

Code Quality:
- Logging für alle Exception-Handler hinzugefügt
- Timeout für Agent-Tasks von 300s auf 600s erhöht (10 Min)
- Bessere Kommentare für Exception-Handling

Performance:
- Wissensdatenbank aus Systemprompt entfernt
- Agents nutzen @READ_KNOWLEDGE für on-demand Zugriff
- Reduziert Prompt-Größe um ~15KB pro Task

UI Improvements (aus vorherigem Work):
- Tasks: Auto-Refresh Info statt Toggle
- Tasks: Status-Anzeigen statt manuelle Buttons
- Konsistentes Auto-Refresh (15s) wenn Tasks aktiv
2026-02-21 12:36:24 +01:00
93eb8c6d47 feat: Dynamische KI-Modelle, verbessertes Memory-System und Chat-Überarbeitung
🎯 KI-Modellverwaltung
- Dynamisches Laden verfügbarer Modelle via opencode models
- 29 Modelle verfügbar (opencode, anthropic, ollama)
- Gruppierung nach Anbieter in UI
- Cache-Mechanismus (1h TTL) für Performance
- API-Endpoint /api/models für Modellabfrage

🧠 Memory-System komplett überarbeitet
- JSON-basierte strukturierte Erinnerungen statt Markdown-Chaos
- Separate Memory-Typen: tasks.json, notes.json, research.json
- Automatische Memory-Zusammenfassung im Systemprompt
- Limitierung auf letzte 100 Einträge pro Typ
- Vollständige Task-Ergebnisse statt abgeschnittener Texte

📁 Agenten-Ordnerstruktur
- work/ Verzeichnis für Agent-Dateien
- memory/ Verzeichnis für strukturierte Erinnerungen
- Agenten arbeiten nur in eigenem work-Verzeichnis
- Absolute Pfade werden übergeben
- Dateien-UI zeigt Agent-Work-Folders

💬 Chat-System überarbeitet
- Echte Agent-Ausführung statt Mock-Responses
- Server-Sent Events für Live-Streaming
- Session-basierte Chat-History
- Loading-Spinner und Status-Anzeigen
- Automatisches Speichern in Session

🎭 Personality Integration
- personality.md wird jetzt geladen
- Persönlichkeit vor Systemprompt eingefügt
- Gilt für alle: Chat, Tasks, Orchestrator, Email-Poller

 Weitere Verbesserungen
- Alle Agenten nutzen execute_agent_task() zentral
- Memory-Speicherung nach jedem Task
- Work-Files in Datei-Verwaltung sichtbar
- System-Dateien ausgeblendet
- API-Route für Agent-Work-Dateien
2026-02-21 11:44:06 +01:00
84b2fe3dd7 Add agent reminders, model selection, task distribution and delete functionality 2026-02-20 22:37:58 +01:00
Pjot
56d9bc2c76 feat: initial commit – Frankenbot Multi-Agent Orchestration System
- Flask Web-App mit Dashboard, Chat, Orchestrator, Tasks, Dateien, Emails, Agenten, Settings
- Email-Poller (IMAP) mit SQLite-Journal als Failsafe (kein Emailverlust bei Absturz)
- Failsafe-Fenster und Poll-Intervall zur Laufzeit via /settings konfigurierbar
- TaskWorker: IMAP Seen-Flag erst nach erfolgreichem Task-Abschluss
- Whitelist-Filter: eric.fischer, p.dyderski, georg.tschare (gmail + signtime.media), *@diversityball.at
- 9 Agenten: researcher, tax_advisor, document_editor, location_manager, program_manager,
  catering_manager, musik_rechte_advisor, zusammenfasser, orchestration_ui
- Diversity Ball Wien 2026 – Wissensdatenbank, Sponsoringverträge, Email-Vorlagen
2026-02-20 17:31:16 +01:00