feat: agent platform initial commit

- FastAPI + HTMX UI: dashboard, agents CRUD, chat, audit, tools
- SQLite schema: agents, conversations, messages, audit, sessions
- Code-agent sync (agents/*.py -> DB on startup)
- MCP client with health check
- Token auth (Bearer + session)
- LiteLLM integration via llm.py
- Docker Compose: agent-platform + mcp-tools services
- Smoke tests pass: /health 200, /api/agents 200, / 401
This commit is contained in:
Leopold
2026-07-05 22:18:00 +02:00
commit 64b840c94c
30 changed files with 2690 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
{% extends "base.html" %}
{% block title %}Agents Agent Platform{% endblock %}
{% block content %}
<div class="page-header">
<h1>Agents</h1>
<a href="/agents/new" class="btn btn-primary">+ Neuer Agent</a>
</div>
<section class="card">
<p><small><strong>Hinweis:</strong> Code-Agents (definiert in <code>agents/*.py</code>) werden beim Start in die DB synchronisiert. Du kannst sie hier anpassen oder neue Agents rein in der DB anlegen.</small></p>
</section>
<section class="card">
<h2>{{ agents|length }} Agent(s)</h2>
{% if agents %}
<table class="table">
<thead>
<tr><th>ID</th><th>Name</th><th>Quelle</th><th>Tools</th><th>Status</th><th>Aktionen</th></tr>
</thead>
<tbody>
{% for agent in agents %}
<tr>
<td><code>{{ agent.id }}</code></td>
<td>{{ agent.name }}</td>
<td>
{% if agent.source == "code" %}
<span class="badge badge-blue">Code</span>
{% else %}
<span class="badge">DB</span>
{% endif %}
</td>
<td><small>{{ agent.allowed_tools|length }} Tool(s)</small></td>
<td>
{% if agent.enabled %}
<span class="badge badge-green">aktiv</span>
{% else %}
<span class="badge badge-red">inaktiv</span>
{% endif %}
</td>
<td>
<a href="/agents/{{ agent.id }}" class="btn btn-sm">Edit</a>
{% if agent.enabled %}
<button hx-post="/api/agents/{{ agent.id }}/disable" hx-swap="none" hx-on::after-request="location.reload()" class="btn btn-sm">Disable</button>
{% else %}
<button hx-post="/api/agents/{{ agent.id }}/enable" hx-swap="none" hx-on::after-request="location.reload()" class="btn btn-sm">Enable</button>
{% endif %}
<button hx-delete="/api/agents/{{ agent.id }}" hx-confirm="Wirklich löschen?" hx-swap="none" hx-on::after-request="location.reload()" class="btn btn-sm btn-danger">Delete</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="empty-state">Keine Agents vorhanden. <a href="/agents/new">Ersten Agent anlegen</a></p>
{% endif %}
</section>
{% endblock %}