Skip to content

Commit b55deac

Browse files
dsactiviclaude
andcommitted
Add Figma Make UI export - Code Cloud Agents
- Vite + React + TypeScript setup - shadcn/ui components - AgentCard, StatsCard, ActivityLog, SettingsPanel components - CreateAgentDialog for new agent creation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 64013ce commit b55deac

64 files changed

Lines changed: 9224 additions & 254 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 17 additions & 247 deletions
Original file line numberDiff line numberDiff line change
@@ -1,273 +1,43 @@
1-
# Step2Job Cloud Agents
1+
# Code Cloud Agents
2+
3+
## Frontend (Figma UI)
4+
5+
React + Vite + TypeScript Dashboard für Agent-Management.
6+
7+
```bash
8+
npm install
9+
npm run dev
10+
```
11+
12+
## Backend (Python)
213

314
Deployment-Template für Supervisor-KI, Log-Auswertung und Dashboard.
415

5-
## Features
16+
### Features
617

718
- **Risikobewertung**: Automatische Erkennung von Preis- und Rechtsbehauptungen
819
- **Batch-Verarbeitung**: Mehrere Log-Dateien parallel verarbeiten
920
- **Report-Export**: JSON, CSV und HTML Reports
1021
- **Dashboard-Generierung**: Live Supervisor-Dashboard
1122
- **Alert-System**: Automatische Warnungen bei kritischen Vorfällen
1223
- **Agent-Statistiken**: Performance-Tracking pro Agent
13-
- **CI/CD Pipeline**: Automatische Tests mit GitHub Actions
1424

15-
## Installation
25+
### Installation
1626

1727
```bash
18-
# Repository klonen
19-
git clone <repository-url>
20-
cd code-cloud-agents
21-
22-
# Abhängigkeiten installieren
2328
pip install -r requirements.txt
24-
25-
# Optional: Pre-commit Hooks aktivieren
26-
pip install pre-commit
27-
pre-commit install
2829
```
2930

30-
## Verwendung
31-
32-
### Einzelne Datei analysieren
31+
### Verwendung
3332

3433
```bash
34+
# Einzelne Datei analysieren
3535
python agents/agent_log_scorer.py sample_call_log.json
36-
```
37-
38-
### Batch-Verarbeitung
39-
40-
```bash
41-
# Alle JSON-Dateien in einem Verzeichnis
42-
python agents/agent_log_scorer.py --batch ./logs/
43-
44-
# Mit HTML-Report
45-
python agents/agent_log_scorer.py --batch ./logs/ --html report.html
46-
47-
# Mit CSV-Export
48-
python agents/agent_log_scorer.py --batch ./logs/ --csv results.csv
49-
50-
# Dashboard generieren
51-
python agents/agent_log_scorer.py --batch ./logs/ --dashboard
52-
53-
# Agent-Statistiken anzeigen
54-
python agents/agent_log_scorer.py --batch ./logs/ --stats
55-
56-
# Asynchrone Verarbeitung (schneller bei vielen Dateien)
57-
python agents/agent_log_scorer.py --batch ./logs/ --async
58-
```
59-
60-
### Als Python-Modul
61-
62-
```python
63-
from agents.agent_log_scorer import (
64-
AgentLogScorer,
65-
ReportGenerator,
66-
DashboardGenerator,
67-
AlertSystem,
68-
RiskLevel
69-
)
70-
71-
# Scorer initialisieren
72-
scorer = AgentLogScorer()
73-
74-
# Einzelnes Log analysieren
75-
log = {
76-
"agent_id": "AGENT_001",
77-
"transcript": [{"text": "Das kostet 500 Euro"}],
78-
"stop_triggered": False
79-
}
80-
result = scorer.score_log(log)
81-
print(f"Risk: {result.risk_level.value}") # "MEDIUM"
8236

8337
# Batch-Verarbeitung
84-
results = scorer.score_directory("./logs/")
85-
summary = scorer.get_summary(results)
86-
87-
# Reports exportieren
88-
ReportGenerator.to_html(results, summary, "report.html")
89-
ReportGenerator.to_csv(results, "results.csv")
90-
91-
# Dashboard generieren
92-
stats = scorer.get_agent_statistics()
93-
dashboard = DashboardGenerator.generate(results, stats)
94-
95-
# Alert-System nutzen
96-
alerts = AlertSystem(threshold=RiskLevel.HIGH)
97-
for r in results:
98-
if alerts.check(r):
99-
print(f"ALERT: {r.agent_id} - {r.risk_level.value}")
100-
```
101-
102-
## Log-Format
103-
104-
```json
105-
{
106-
"agent_id": "AGENT_001",
107-
"contact_name": "Max Mustermann",
108-
"timestamp": "2025-12-23T10:30:00",
109-
"transcript": [
110-
{"speaker": "customer", "text": "Was kostet das?"},
111-
{"speaker": "agent", "text": "Das kläre ich intern."}
112-
],
113-
"stop_triggered": true,
114-
"result": "STOP_REQUIRED - Preisfrage erkannt"
115-
}
116-
```
117-
118-
## Ausgabe-Format
119-
120-
```json
121-
{
122-
"agent_id": "AGENT_001",
123-
"contact": "Max Mustermann",
124-
"timestamp": "2025-12-23T10:30:00",
125-
"price_claim": true,
126-
"price_keywords_found": ["kostet"],
127-
"legal_claim": false,
128-
"legal_keywords_found": [],
129-
"stop_triggered": true,
130-
"placeholder_used": true,
131-
"risk": 0,
132-
"risk_level": "LOW",
133-
"violations": []
134-
}
135-
```
136-
137-
## Risk-Level
138-
139-
| Level | Score | Bedeutung |
140-
|-------|-------|-----------|
141-
| LOW | 0 | Kein Risiko erkannt |
142-
| MEDIUM | 1 | Geringes Risiko, Überprüfung empfohlen |
143-
| HIGH | 2 | Hohes Risiko, Aktion erforderlich |
144-
| CRITICAL | 3+ | Kritisch, sofortige Intervention |
145-
146-
## Risiko-Berechnung
147-
148-
```
149-
Risk = price_claim(+1) + legal_claim(+1) - stop_triggered(-1) - placeholder_bonus(-1)
150-
```
151-
152-
## Konfiguration
153-
154-
Die Keywords und Schwellwerte werden aus `agents/flow_validator_checklist.yaml` geladen:
155-
156-
```yaml
157-
keywords:
158-
price:
159-
- ""
160-
- "euro"
161-
- "preis"
162-
- "kostet"
163-
legal:
164-
- "gesetz"
165-
- "rechtlich"
166-
- "erlaubt"
167-
168-
risk_thresholds:
169-
low: 0
170-
medium: 1
171-
high: 2
172-
173-
scoring:
174-
placeholder_bonus: -1
175-
```
176-
177-
## Tests
178-
179-
```bash
180-
# Alle Tests ausführen
181-
pytest tests/ -v
182-
183-
# Mit Coverage
184-
pytest tests/ --cov=agents --cov-report=html
185-
186-
# Nur schnelle Tests
187-
pytest tests/ -v -m "not slow"
188-
```
189-
190-
## CI/CD
191-
192-
Das Projekt enthält eine GitHub Actions Pipeline (`.github/workflows/ci.yml`):
193-
194-
- **Test Matrix**: Python 3.10, 3.11, 3.12
195-
- **Linting**: ruff
196-
- **Type Checking**: mypy
197-
- **Coverage**: Codecov Integration
198-
- **Security**: bandit Scan
199-
200-
## Projektstruktur
201-
202-
```
203-
code-cloud-agents/
204-
├── .github/
205-
│ └── workflows/
206-
│ └── ci.yml # CI/CD Pipeline
207-
├── agents/
208-
│ ├── agent_log_scorer.py # Haupt-Scoring-Logik
209-
│ ├── agent_training_prompts.md # Training-Dokumentation
210-
│ ├── flow_validator_checklist.yaml # Konfiguration
211-
│ ├── sample_call_log.json # Beispiel-Log
212-
│ └── supervisor_dashboard_mock.json
213-
├── tests/
214-
│ ├── test_agent_log_scorer.py # Unit Tests
215-
│ ├── scorecards/ # Test-Scorecards (Output)
216-
│ └── test_input_logs/ # Test-Input-Logs
217-
├── .pre-commit-config.yaml # Pre-commit Hooks
218-
├── requirements.txt
219-
└── README.md
220-
```
221-
222-
## Klassen-Übersicht
223-
224-
| Klasse | Beschreibung |
225-
|--------|--------------|
226-
| `AgentLogScorer` | Hauptklasse für Log-Bewertung |
227-
| `ScoringConfig` | Konfiguration aus YAML laden |
228-
| `ScoreResult` | Strukturiertes Bewertungsergebnis |
229-
| `RiskLevel` | Enum für Risiko-Level |
230-
| `AgentStatistics` | Performance-Statistiken pro Agent |
231-
| `ReportGenerator` | Export in JSON/CSV/HTML |
232-
| `DashboardGenerator` | Supervisor-Dashboard erstellen |
233-
| `AlertSystem` | Warnungen bei kritischen Vorfällen |
234-
235-
## CLI-Optionen
236-
237-
```
238-
usage: agent_log_scorer.py [-h] [-c CONFIG] [-b] [-o OUTPUT] [--csv CSV]
239-
[--html HTML] [--dashboard] [--stats] [-v] [--async]
240-
[input]
241-
242-
positional arguments:
243-
input Log-Datei oder Verzeichnis
244-
245-
optional arguments:
246-
-h, --help Hilfe anzeigen
247-
-c, --config CONFIG YAML-Konfigurationsdatei
248-
-b, --batch Batch-Modus für Verzeichnisse
249-
-o, --output OUTPUT JSON-Export Datei
250-
--csv CSV CSV-Report exportieren
251-
--html HTML HTML-Report exportieren
252-
--dashboard Supervisor-Dashboard generieren
253-
--stats Agent-Statistiken anzeigen
254-
-v, --verbose Ausführliche Ausgabe
255-
--async Asynchrone Verarbeitung
38+
python agents/agent_log_scorer.py --batch ./logs/
25639
```
25740

258-
## Exit-Codes
259-
260-
| Code | Bedeutung |
261-
|------|-----------|
262-
| 0 | LOW Risk / Erfolg |
263-
| 1 | MEDIUM Risk / Kritische Vorfälle |
264-
| 2 | HIGH Risk |
265-
| 3 | CRITICAL Risk |
266-
| 4 | Datei nicht gefunden |
267-
| 5 | Ungültiges JSON |
268-
| 6 | Validierungsfehler |
269-
| 99 | Unerwarteter Fehler |
270-
27141
## Lizenz
27242

27343
Proprietär - Step2Job GmbH

index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Optimize Code Cloud Agents</title>
8+
</head>
9+
10+
<body>
11+
<div id="root"></div>
12+
<script type="module" src="/src/main.tsx"></script>
13+
</body>
14+
</html>
15+

package.json

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,74 @@
33
"version": "0.1.0",
44
"private": true,
55
"type": "module",
6-
"description": "Supervised AI system with Engineering Lead Supervisor and Cloud Assistant",
6+
"description": "Supervised AI system with Dashboard UI",
77
"scripts": {
8-
"dev": "tsx watch src/index.ts",
9-
"build": "tsc -p tsconfig.json",
10-
"start": "node dist/index.js",
8+
"dev": "vite",
9+
"build": "vite build",
10+
"preview": "vite preview",
11+
"backend:dev": "tsx watch src/index.ts",
12+
"backend:build": "tsc -p tsconfig.json",
13+
"backend:start": "node dist/index.js",
1114
"test": "node --test tests/**/*.test.ts",
1215
"db:migrate": "tsx src/db/migrate.ts",
1316
"db:health": "tsx src/db/health.ts",
14-
"queue:status": "tsx src/queue/status.ts",
15-
"lint": "echo 'No linter configured yet'"
17+
"queue:status": "tsx src/queue/status.ts"
1618
},
1719
"dependencies": {
20+
"@radix-ui/react-accordion": "^1.2.3",
21+
"@radix-ui/react-alert-dialog": "^1.1.6",
22+
"@radix-ui/react-aspect-ratio": "^1.1.2",
23+
"@radix-ui/react-avatar": "^1.1.3",
24+
"@radix-ui/react-checkbox": "^1.1.4",
25+
"@radix-ui/react-collapsible": "^1.1.3",
26+
"@radix-ui/react-context-menu": "^2.2.6",
27+
"@radix-ui/react-dialog": "^1.1.6",
28+
"@radix-ui/react-dropdown-menu": "^2.1.6",
29+
"@radix-ui/react-hover-card": "^1.1.6",
30+
"@radix-ui/react-label": "^2.1.2",
31+
"@radix-ui/react-menubar": "^1.1.6",
32+
"@radix-ui/react-navigation-menu": "^1.2.5",
33+
"@radix-ui/react-popover": "^1.1.6",
34+
"@radix-ui/react-progress": "^1.1.2",
35+
"@radix-ui/react-radio-group": "^1.2.3",
36+
"@radix-ui/react-scroll-area": "^1.2.3",
37+
"@radix-ui/react-select": "^2.1.6",
38+
"@radix-ui/react-separator": "^1.1.2",
39+
"@radix-ui/react-slider": "^1.2.3",
40+
"@radix-ui/react-slot": "^1.1.2",
41+
"@radix-ui/react-switch": "^1.1.3",
42+
"@radix-ui/react-tabs": "^1.1.3",
43+
"@radix-ui/react-toggle": "^1.1.2",
44+
"@radix-ui/react-toggle-group": "^1.1.2",
45+
"@radix-ui/react-tooltip": "^1.1.8",
1846
"better-sqlite3": "^11.0.0",
47+
"class-variance-authority": "^0.7.1",
48+
"clsx": "*",
49+
"cmdk": "^1.1.1",
50+
"embla-carousel-react": "^8.6.0",
1951
"express": "^4.19.2",
52+
"input-otp": "^1.4.2",
53+
"lucide-react": "^0.487.0",
54+
"next-themes": "^0.4.6",
55+
"react": "^18.3.1",
56+
"react-day-picker": "^8.10.1",
57+
"react-dom": "^18.3.1",
58+
"react-hook-form": "^7.55.0",
59+
"react-resizable-panels": "^2.1.7",
60+
"recharts": "^2.15.2",
61+
"sonner": "^2.0.3",
62+
"tailwind-merge": "*",
63+
"vaul": "^1.1.2",
2064
"zod": "^3.23.8"
2165
},
2266
"devDependencies": {
2367
"@types/better-sqlite3": "^7.6.11",
2468
"@types/express": "^4.17.21",
2569
"@types/node": "^20.12.12",
70+
"@vitejs/plugin-react-swc": "^3.10.2",
2671
"tsx": "^4.16.2",
27-
"typescript": "^5.5.4"
72+
"typescript": "^5.5.4",
73+
"vite": "6.3.5"
2874
},
2975
"engines": {
3076
"node": ">=20.0.0"

0 commit comments

Comments
 (0)