Compare commits
4 Commits
main
...
304a7a644c
| Author | SHA1 | Date | |
|---|---|---|---|
| 304a7a644c | |||
| e16788a3cb | |||
| 3bd5197867 | |||
| 57fbc57a54 |
10
.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
vite.config.js.timestamp-*
|
||||||
|
vite.config.ts.timestamp-*
|
||||||
7
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"svelte.svelte-vscode",
|
||||||
|
"tauri-apps.tauri-vscode",
|
||||||
|
"rust-lang.rust-analyzer"
|
||||||
|
]
|
||||||
|
}
|
||||||
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"svelte.enable-ts-plugin": true
|
||||||
|
}
|
||||||
@ -33,12 +33,12 @@ für einen Block aufweichen; das steht dann im Todo.
|
|||||||
## lauf2sandbox
|
## lauf2sandbox
|
||||||
**Zweck:** Ein Lauf startet in einem frischen Container ohne Netz und räumt danach auf.
|
**Zweck:** Ein Lauf startet in einem frischen Container ohne Netz und räumt danach auf.
|
||||||
**Deckt ab:** #1004
|
**Deckt ab:** #1004
|
||||||
**Voraussetzung:** Docker läuft, Image `cb-python:latest` vorhanden.
|
**Voraussetzung:** Podman läuft, Image `cb-python:latest` vorhanden.
|
||||||
|
|
||||||
| Test | Schritte | Erwartet | Art |
|
| Test | Schritte | Erwartet | Art |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| lauf2sandbox.1 | Einen Lauf starten, im Agenten `curl` auf eine externe Adresse ausführen lassen | Netzwerk ist nicht erreichbar | manuell |
|
| lauf2sandbox.1 | Einen Lauf starten, im Agenten `curl` auf eine externe Adresse ausführen lassen | Netzwerk ist nicht erreichbar | manuell |
|
||||||
| lauf2sandbox.2 | Nach Lauf-Ende Docker-Containerliste prüfen | Kein Container des Laufs mehr vorhanden, `/work` liegt als Artefakt vor | manuell |
|
| lauf2sandbox.2 | Nach Lauf-Ende Podman-Containerliste prüfen | Kein Container des Laufs mehr vorhanden, `/work` liegt als Artefakt vor | manuell |
|
||||||
|
|
||||||
## lauf2ergebnis
|
## lauf2ergebnis
|
||||||
**Zweck:** Ein Agentenlauf wird bewertet und mit Schritten gespeichert.
|
**Zweck:** Ein Agentenlauf wird bewertet und mit Schritten gespeichert.
|
||||||
|
|||||||
10
README.md
@ -16,9 +16,9 @@ Getestet auf: nichts. Die Zielplattform ist Linux (Pop!_OS), dort ist noch nicht
|
|||||||
|
|
||||||
## Before you use it
|
## Before you use it
|
||||||
|
|
||||||
**Ausführung von Modellbefehlen:** Das Modell darf im Container Shell-Befehle ausführen. Die Läufe sind dafür per Docker abgeschottet (kein Netzwerk). Trotzdem sollten Aufgaben-Ordner vor dem Start geprüft werden.
|
**Ausführung von Modellbefehlen:** Das Modell darf im Container Shell-Befehle ausführen. Die Läufe sind dafür per Podman abgeschottet (kein Netzwerk). Trotzdem sollten Aufgaben-Ordner vor dem Start geprüft werden.
|
||||||
|
|
||||||
**Docker nötig:** Jeder Lauf braucht Docker. Ohne Docker startet kein Lauf.
|
**Podman nötig:** Jeder Lauf braucht Podman (rootless). Ohne Podman startet kein Lauf.
|
||||||
|
|
||||||
**Disclaimer:** coding-bench ist nicht verbunden mit oder gesponsert von Dritten. Das Projekt wird im Ist-Zustand und ohne Garantie bereitgestellt.
|
**Disclaimer:** coding-bench ist nicht verbunden mit oder gesponsert von Dritten. Das Projekt wird im Ist-Zustand und ohne Garantie bereitgestellt.
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ Noch nicht verfügbar. Installationshinweise folgen mit dem ersten Release.
|
|||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* Linux (Pop!_OS als Zielplattform)
|
* Linux (Pop!_OS als Zielplattform)
|
||||||
* Docker
|
* Podman (rootless)
|
||||||
* Rust-Toolchain und Node.js (für den Build, Details folgen)
|
* Rust-Toolchain und Node.js (für den Build, Details folgen)
|
||||||
* Ollama mit Modellen, die Tool-Calling unterstützen
|
* Ollama mit Modellen, die Tool-Calling unterstützen
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ Der Nutzer wählt Aufgaben und Modelle. Jedes Modell löst jede Aufgabe mehrfach
|
|||||||
| :--- | :--- |
|
| :--- | :--- |
|
||||||
| **Aufgaben** | Ordner mit Prompt, Startdateien und `check.sh`, beim Laden validiert. |
|
| **Aufgaben** | Ordner mit Prompt, Startdateien und `check.sh`, beim Laden validiert. |
|
||||||
| **Agent-Loop** | Modell und Tools (`read_file`, `write_file`, `list_dir`, `run_shell`, `done`) mit Fehlerklassen. |
|
| **Agent-Loop** | Modell und Tools (`read_file`, `write_file`, `list_dir`, `run_shell`, `done`) mit Fehlerklassen. |
|
||||||
| **Sandbox** | Frischer Docker-Container pro Lauf, ohne Netzwerk. |
|
| **Sandbox** | Frischer Podman-Container pro Lauf, ohne Netzwerk. |
|
||||||
| **Runner** | Wiederholungen, Abbruch und Fortsetzen eines Batches. |
|
| **Runner** | Wiederholungen, Abbruch und Fortsetzen eines Batches. |
|
||||||
| **Ranking** | Gesamtscore mit Intervall, Matrix Modell × Test (geplant für 0.2.0: Kategorien, Export). |
|
| **Ranking** | Gesamtscore mit Intervall, Matrix Modell × Test (geplant für 0.2.0: Kategorien, Export). |
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ Noch nicht verfügbar.
|
|||||||
|
|
||||||
* **[Ollama](https://ollama.com)** – lokale Modelle mit Tool-Calling über `/api/chat`.
|
* **[Ollama](https://ollama.com)** – lokale Modelle mit Tool-Calling über `/api/chat`.
|
||||||
* **[Tauri](https://tauri.app)** – Desktop-Framework mit Rust-Backend.
|
* **[Tauri](https://tauri.app)** – Desktop-Framework mit Rust-Backend.
|
||||||
* **[Docker](https://www.docker.com)** – Sandbox pro Lauf.
|
* **[Podman](https://podman.io)** – Sandbox pro Lauf.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
19
ROADMAP.md
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
Stand: 2026-11-06 (18:30) · Projekt-ID: offen · Format: 1 · installiert ist noch nichts (Release 0.1.0 offen); lokal 0 Commits. Quellen dieser Liste: `SPEC.md` (Gespräch vom 06.11.2026), Anforderungskatalog F-01 bis F-17.
|
Stand: 2026-11-06 (18:30) · Projekt-ID: offen · Format: 1 · installiert ist noch nichts (Release 0.1.0 offen); lokal 0 Commits. Quellen dieser Liste: `SPEC.md` (Gespräch vom 06.11.2026), Anforderungskatalog F-01 bis F-17.
|
||||||
Zeichen: ✓ fertig · ◐ teilweise · ✗ offen · ? nicht geprüft.
|
Zeichen: ✓ fertig · ◐ teilweise · ✗ offen · ? nicht geprüft.
|
||||||
**IDs:** Jeder Punkt in Stand-Tabelle, Todo, Entscheidungen und Risiken hat eine feste ID `#1xxx` (eine Zählung für alles, nie wiederverwendet, am Anfang der Zeile). „→ #…“ nennt die Anforderung, die ein Todo voranbringt. Erledigtes wandert mit ID in „Erledigt (einzeln)“. Nächste freie ID: #1039.
|
**IDs:** Jeder Punkt in Stand-Tabelle, Todo, Entscheidungen und Risiken hat eine feste ID `#1xxx` (eine Zählung für alles, nie wiederverwendet, am Anfang der Zeile). „→ #…“ nennt die Anforderung, die ein Todo voranbringt. Erledigtes wandert mit ID in „Erledigt (einzeln)“. Nächste freie ID: #1040.
|
||||||
|
|
||||||
## 1. Leitplanken (von dir festgelegt, gelten für alles)
|
## 1. Leitplanken (von dir festgelegt, gelten für alles)
|
||||||
- **Lokal first:** Nur lokale Modelle (Ollama, ab Phase 2 OpenAI-kompatibler Endpunkt im Netz). Cloud-Modelle werden nicht verglichen (Nicht-Ziel v1).
|
- **Lokal first:** Nur lokale Modelle (Ollama, ab Phase 2 OpenAI-kompatibler Endpunkt im Netz). Cloud-Modelle werden nicht verglichen (Nicht-Ziel v1).
|
||||||
- **Sandbox:** Jeder Lauf in einem frischen Docker-Container mit `--network none`. Der Agent arbeitet nur unter `/work`.
|
- **Sandbox:** Jeder Lauf in einem frischen Podman-Container mit `--network none`. Der Agent arbeitet nur unter `/work`.
|
||||||
- **Sequentiell:** Modelle laufen nacheinander, weil ein Modell die GPU belegt. Parallelität nur, wenn du `parallel > 1` setzt.
|
- **Sequentiell:** Modelle laufen nacheinander, weil ein Modell die GPU belegt. Parallelität nur, wenn du `parallel > 1` setzt.
|
||||||
- **Versionierung:** System-Prompt und Limits werden pro Batch in `config_json` mitgespeichert, damit Läufe vergleichbar bleiben.
|
- **Versionierung:** System-Prompt und Limits werden pro Batch in `config_json` mitgespeichert, damit Läufe vergleichbar bleiben.
|
||||||
- **Plattform und Stack:** Linux (Pop!_OS) zuerst. Tauri 2, Rust-Backend, Svelte mit TypeScript fürs Frontend, SQLite für Ergebnisse.
|
- **Plattform und Stack:** Linux (Pop!_OS) zuerst. Tauri 2, Rust-Backend, Svelte mit TypeScript fürs Frontend, SQLite für Ergebnisse.
|
||||||
@ -18,10 +18,10 @@ Zeichen: ✓ fertig · ◐ teilweise · ✗ offen · ? nicht geprüft.
|
|||||||
|
|
||||||
| ID | Anforderung | Quelle | Stand | Anmerkung |
|
| ID | Anforderung | Quelle | Stand | Anmerkung |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| #1001 | F-01 Tauri-Grundgerüst, Datenordner, Config | SPEC 12 | ✗ | noch nicht begonnen (→ #1018) |
|
| #1001 | F-01 Tauri-Grundgerüst, Datenordner, Config | SPEC 12 | ◐ | Umgesetzt: Gerüst, TOML-Config mit Standardanlage, Datenordner, Setup zeigt Pfade. `cargo test` 6/6, `npm run build` grün. Klicktests `start2app.1–.2` manuell noch nicht ✓ (→ #1018) |
|
||||||
| #1002 | F-02 Aufgaben laden und validieren | SPEC 4, 12 | ✗ | noch nicht begonnen (→ #1019) |
|
| #1002 | F-02 Aufgaben laden und validieren | SPEC 4, 12 | ◐ | Umgesetzt: Laden, Validierung (Pflichtdateien, TOML, Werte, `check.sh` ausführbar), Fehler im Setup. `cargo test` 13/13. Klicktests `aufgabe2validierung.1–.2` manuell offen (→ #1019) |
|
||||||
| #1003 | F-03 Agent-Loop gegen Ollama mit Tools und Fehlerklassen | SPEC 5, 12 | ✗ | noch nicht begonnen (→ #1021) |
|
| #1003 | F-03 Agent-Loop gegen Ollama mit Tools und Fehlerklassen | SPEC 5, 12 | ✗ | noch nicht begonnen (→ #1021) |
|
||||||
| #1004 | F-04 Docker-Sandbox pro Lauf | SPEC 6, 12 | ✗ | noch nicht begonnen (→ #1020) |
|
| #1004 | F-04 Podman-Sandbox pro Lauf | SPEC 6, 12 | ✗ | noch nicht begonnen (→ #1020) |
|
||||||
| #1005 | F-05 Runner mit Wiederholungen, Abbruch, Fortsetzen | SPEC 7, 12 | ✗ | noch nicht begonnen (→ #1022) |
|
| #1005 | F-05 Runner mit Wiederholungen, Abbruch, Fortsetzen | SPEC 7, 12 | ✗ | noch nicht begonnen (→ #1022) |
|
||||||
| #1006 | F-06 SQLite inkl. Schritt-Log | SPEC 8, 12 | ✗ | noch nicht begonnen (→ #1023) |
|
| #1006 | F-06 SQLite inkl. Schritt-Log | SPEC 8, 12 | ✗ | noch nicht begonnen (→ #1023) |
|
||||||
| #1007 | F-07 Tests a-01 bis a-03 und b-04 bis b-06 | SPEC 11, 12 | ✗ | noch nicht begonnen (→ #1024) |
|
| #1007 | F-07 Tests a-01 bis a-03 und b-04 bis b-06 | SPEC 11, 12 | ✗ | noch nicht begonnen (→ #1024) |
|
||||||
@ -44,14 +44,14 @@ Zeichen: ✓ fertig · ◐ teilweise · ✗ offen · ? nicht geprüft.
|
|||||||
## 4. Todo (nach Priorität, Stand 2026-11-06)
|
## 4. Todo (nach Priorität, Stand 2026-11-06)
|
||||||
|
|
||||||
**P1 – als Nächstes (Release 0.1.0, Phase 1 Kern)**
|
**P1 – als Nächstes (Release 0.1.0, Phase 1 Kern)**
|
||||||
- [#1018] **Gerüst anlegen.** Tauri 2 mit Svelte und TypeScript, Rust-Backend, Datenordner, TOML-Config. Tests `start2app.1–.2`. → #1001
|
- [#1018] **Gerüst anlegen.** Tauri 2 mit Svelte und TypeScript, Rust-Backend, Datenordner, TOML-Config. Gerüst (`create-tauri-app`, svelte-ts) und Config-/Datenordner-Logik (`src-tauri/src/config.rs`) sind gebaut; `cargo test` 6/6 grün. Offen: die Klicktests `start2app.1–.2` vom Menschen manuell ausführen lassen. Erst dann gilt #1018 als fertig. Tests `start2app.1–.2`. → #1001
|
||||||
- [#1019] **Aufgaben laden und validieren.** Ordner `tasks/<gruppe>/<name>/`, Pflichtdateien, TOML, ausführbares `check.sh`, Fehler in der GUI. Tests `aufgabe2validierung.1–.2`. → #1002
|
- [#1019] **Aufgaben laden und validieren.** Umgesetzt in `src-tauri/src/tasks.rs`, `cargo test` 13/13. Offen: Klicktests `aufgabe2validierung.1–.2` manuell ausführen lassen. Tests `aufgabe2validierung.1–.2`. → #1002
|
||||||
- [#1020] **Docker-Sandbox pro Lauf.** Frischer Container, `--network none`, Speicher-/CPU-Limit, `/work` als Artefakt, Container entfernen. Tests `lauf2sandbox.1–.2`. → #1004
|
- [#1020] **Podman-Sandbox pro Lauf.** Frischer Container, `--network none`, Speicher-/CPU-Limit, `/work` als Artefakt, Container entfernen. Tests `lauf2sandbox.1–.2`. → #1004
|
||||||
- [#1021] **Agent-Loop gegen Ollama.** Tools `read_file`, `write_file`, `list_dir`, `run_shell`, `done`; Pfade auf `/work`; Fehlerklassen und Metriken. Tests `lauf2ergebnis.1–.3`. → #1003
|
- [#1021] **Agent-Loop gegen Ollama.** Tools `read_file`, `write_file`, `list_dir`, `run_shell`, `done`; Pfade auf `/work`; Fehlerklassen und Metriken. Tests `lauf2ergebnis.1–.3`. → #1003
|
||||||
- [#1022] **Runner.** Wiederholungen, sequentiell pro Modell, Aufwärmen, Abbruch und Fortsetzen. Tests `batch2fortsetzen.1–.2`. → #1005
|
- [#1022] **Runner.** Wiederholungen, sequentiell pro Modell, Aufwärmen, Abbruch und Fortsetzen. Tests `batch2fortsetzen.1–.2`. → #1005
|
||||||
- [#1023] **SQLite-Speicher.** Tabellen `batch`, `run`, `step` nach Abschnitt 8. Tests `lauf2ergebnis.2`. → #1006
|
- [#1023] **SQLite-Speicher.** Tabellen `batch`, `run`, `step` nach Abschnitt 8. Tests `lauf2ergebnis.2`. → #1006
|
||||||
- [#1024] **Aufgaben a-01 bis a-03, b-04 bis b-06 schreiben.** Mindestens je ein lauffähiges Beispiel, Mutation bei b-06. Tests: je Aufgabe ein Lauf mit Bericht. → #1007
|
- [#1024] **Aufgaben a-01 bis a-03, b-04 bis b-06 schreiben.** Mindestens je ein lauffähiges Beispiel, Mutation bei b-06. Tests: je Aufgabe ein Lauf mit Bericht. → #1007
|
||||||
- [#1025] **GUI Setup und Batch.** Modelle, Docker-Status, Datenordner, Aufgabenauswahl, Start, Live-Fortschritt mit Schritt-Log. Tests `batch2fortsetzen.1`. → #1008
|
- [#1025] **GUI Setup und Batch.** Modelle, Podman-Status, Datenordner, Aufgabenauswahl, Start, Live-Fortschritt mit Schritt-Log. Tests `batch2fortsetzen.1`. → #1008
|
||||||
- [#1026] **Rangliste und Matrix.** Gesamtscore mit Intervall, Matrix Modell × Test nach Erfolgsquote, Lauf-Detail. Tests `ergebnis2detail.1`. → #1009
|
- [#1026] **Rangliste und Matrix.** Gesamtscore mit Intervall, Matrix Modell × Test nach Erfolgsquote, Lauf-Detail. Tests `ergebnis2detail.1`. → #1009
|
||||||
|
|
||||||
**P2 – danach (Release 0.2.0, Referenz und Tiefe)**
|
**P2 – danach (Release 0.2.0, Referenz und Tiefe)**
|
||||||
@ -74,6 +74,7 @@ Zeichen: ✓ fertig · ◐ teilweise · ✗ offen · ? nicht geprüft.
|
|||||||
- [#1034] Entschieden: Projektname `coding-bench`, Ordner bleibt `llm-arena`. → #1001
|
- [#1034] Entschieden: Projektname `coding-bench`, Ordner bleibt `llm-arena`. → #1001
|
||||||
- [#1035] Gitea-Adresse für das Remote `origin` (URL oder Repo-Name)? Ohne sie gibt es kein Remote, und die Projekt-ID bleibt `offen`. → #1001
|
- [#1035] Gitea-Adresse für das Remote `origin` (URL oder Repo-Name)? Ohne sie gibt es kein Remote, und die Projekt-ID bleibt `offen`. → #1001
|
||||||
- [#1036] Entschieden: Lizenz wird vorerst nicht festgelegt, die README sagt das ausdrücklich. → #1001
|
- [#1036] Entschieden: Lizenz wird vorerst nicht festgelegt, die README sagt das ausdrücklich. → #1001
|
||||||
|
- [#1039] Entschieden: Podman (rootless) statt Docker für die Sandbox. Die SPEC ist entsprechend angepasst. Docker ist auf diesem Rechner nicht installiert. → #1004
|
||||||
|
|
||||||
## 6. Roadmap (Aufwand grob, ohne Kalenderdaten)
|
## 6. Roadmap (Aufwand grob, ohne Kalenderdaten)
|
||||||
**0.1.0 – Kern.** Todo: #1018, #1019, #1020, #1021, #1022, #1023, #1024, #1025, #1026. Ziel: Zwei Modelle × sechs Tests × drei Wiederholungen laufen durch, die Rangliste erscheint, ein Einzellauf ist nachvollziehbar, Abbruch und Fortsetzen funktionieren.
|
**0.1.0 – Kern.** Todo: #1018, #1019, #1020, #1021, #1022, #1023, #1024, #1025, #1026. Ziel: Zwei Modelle × sechs Tests × drei Wiederholungen laufen durch, die Rangliste erscheint, ein Einzellauf ist nachvollziehbar, Abbruch und Fortsetzen funktionieren.
|
||||||
|
|||||||
14
SPEC.md
@ -20,7 +20,7 @@ Der Nutzer wählt 1..n Tests und 1..m Modelle. Die App lässt jedes Modell jeden
|
|||||||
| Frontend | Svelte oder React + TypeScript, schlicht, Tabellen und Heatmap |
|
| Frontend | Svelte oder React + TypeScript, schlicht, Tabellen und Heatmap |
|
||||||
| HTTP | `reqwest` + `tokio` |
|
| HTTP | `reqwest` + `tokio` |
|
||||||
| Modell-API | Ollama `/api/chat` mit `tools`; zusätzlich OpenAI-kompatibler Endpunkt (GPU Dispatcher) |
|
| Modell-API | Ollama `/api/chat` mit `tools`; zusätzlich OpenAI-kompatibler Endpunkt (GPU Dispatcher) |
|
||||||
| Sandbox | Docker über `bollard` oder Docker-CLI |
|
| Sandbox | Podman (rootless), Aufruf über die Podman-CLI |
|
||||||
| Speicher | SQLite (`rusqlite`), Artefakte als Dateien im Datenordner |
|
| Speicher | SQLite (`rusqlite`), Artefakte als Dateien im Datenordner |
|
||||||
| Config | TOML (`serde`, `toml`) |
|
| Config | TOML (`serde`, `toml`) |
|
||||||
| Playwright-Sidecar | Kleines Node-Skript, wird von der App als Prozess gestartet (nur Demo-Tests, ab Phase 3) |
|
| Playwright-Sidecar | Kleines Node-Skript, wird von der App als Prozess gestartet (nur Demo-Tests, ab Phase 3) |
|
||||||
@ -36,7 +36,7 @@ Backend (Rust)
|
|||||||
├─ config Modelle, Endpunkte, Pfade
|
├─ config Modelle, Endpunkte, Pfade
|
||||||
├─ tasks Laden/Validieren der Aufgabenordner
|
├─ tasks Laden/Validieren der Aufgabenordner
|
||||||
├─ agent Agent-Loop (Modell <-> Tools)
|
├─ agent Agent-Loop (Modell <-> Tools)
|
||||||
├─ sandbox Docker-Container pro Lauf, Tool-Ausführung
|
├─ sandbox Podman-Container pro Lauf, Tool-Ausführung
|
||||||
├─ runner Job-Queue, Wiederholungen, Abbruch
|
├─ runner Job-Queue, Wiederholungen, Abbruch
|
||||||
├─ scoring Auswertung, Ranking, Statistik
|
├─ scoring Auswertung, Ranking, Statistik
|
||||||
└─ store SQLite + Artefakte
|
└─ store SQLite + Artefakte
|
||||||
@ -62,7 +62,7 @@ id = "b-05-bugfix-parser"
|
|||||||
title = "Bug im Parser finden und fixen"
|
title = "Bug im Parser finden und fixen"
|
||||||
group = "B" # A, B, C, D
|
group = "B" # A, B, C, D
|
||||||
weight = 1.0 # Gewicht im Gesamtscore
|
weight = 1.0 # Gewicht im Gesamtscore
|
||||||
image = "cb-python:latest" # Docker-Image
|
image = "cb-python:latest" # Container-Image
|
||||||
max_steps = 25 # max. Modell-Antworten
|
max_steps = 25 # max. Modell-Antworten
|
||||||
timeout_s = 600 # Gesamtzeit pro Lauf
|
timeout_s = 600 # Gesamtzeit pro Lauf
|
||||||
check_timeout_s = 120
|
check_timeout_s = 120
|
||||||
@ -105,9 +105,9 @@ Pfade sind auf `/work` beschränkt.
|
|||||||
- Ein frischer Container pro Lauf, Image aus `task.toml`.
|
- Ein frischer Container pro Lauf, Image aus `task.toml`.
|
||||||
- `start/` wird nach `/work` kopiert.
|
- `start/` wird nach `/work` kopiert.
|
||||||
- Netzwerk aus (`--network none`), Speicher-/CPU-Limit konfigurierbar.
|
- Netzwerk aus (`--network none`), Speicher-/CPU-Limit konfigurierbar.
|
||||||
- Tool-Ausführung per `docker exec`, `check.sh` im selben Container.
|
- Tool-Ausführung per `podman exec`, `check.sh` im selben Container.
|
||||||
- Nach dem Lauf wird `/work` als Artefakt nach `runs/<run_id>/work/` kopiert, dann wird der Container entfernt.
|
- Nach dem Lauf wird `/work` als Artefakt nach `runs/<run_id>/work/` kopiert, dann wird der Container entfernt.
|
||||||
- Mitgelieferte Images (Dockerfiles im Repo): `cb-python` (Python 3 + pytest), `cb-node` (Node + npm), `cb-rust` (Rust-Toolchain), `cb-web` (Node + Playwright, nur Phase 3).
|
- Mitgelieferte Images (Containerfiles im Repo): `cb-python` (Python 3 + pytest), `cb-node` (Node + npm), `cb-rust` (Rust-Toolchain), `cb-web` (Node + Playwright, nur Phase 3).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ step(id, run_id, idx, role, content, tool_name, tool_args_json,
|
|||||||
|
|
||||||
## 10. GUI
|
## 10. GUI
|
||||||
|
|
||||||
1. **Setup:** Modelle (Name, Endpunkt, Typ Ollama oder OpenAI-kompatibel), Docker-Status, Datenordner, Aufgabenordner mit Validierungsstatus.
|
1. **Setup:** Modelle (Name, Endpunkt, Typ Ollama oder OpenAI-kompatibel), Podman-Status, Datenordner, Aufgabenordner mit Validierungsstatus.
|
||||||
2. **Batch starten:** Tests und Modelle ankreuzen, Wiederholungen, Start. Live-Fortschritt mit laufendem Schritt-Log des aktuellen Laufs.
|
2. **Batch starten:** Tests und Modelle ankreuzen, Wiederholungen, Start. Live-Fortschritt mit laufendem Schritt-Log des aktuellen Laufs.
|
||||||
3. **Ergebnisse:**
|
3. **Ergebnisse:**
|
||||||
- Rangliste (Rang, Modell, Gesamtscore mit Intervall, Score je Gruppe, Median-Zeit, Tokens)
|
- Rangliste (Rang, Modell, Gesamtscore mit Intervall, Score je Gruppe, Median-Zeit, Tokens)
|
||||||
@ -192,7 +192,7 @@ Jede Anforderung hat eine feste ID.
|
|||||||
- F-01 Tauri-Projekt mit Rust-Backend und Frontend-Grundgerüst, Datenordner und Config
|
- F-01 Tauri-Projekt mit Rust-Backend und Frontend-Grundgerüst, Datenordner und Config
|
||||||
- F-02 Aufgaben laden und validieren (Abschnitt 4)
|
- F-02 Aufgaben laden und validieren (Abschnitt 4)
|
||||||
- F-03 Agent-Loop gegen Ollama mit allen Tools und Fehlerklassifikation (Abschnitt 5)
|
- F-03 Agent-Loop gegen Ollama mit allen Tools und Fehlerklassifikation (Abschnitt 5)
|
||||||
- F-04 Docker-Sandbox pro Lauf (Abschnitt 6)
|
- F-04 Podman-Sandbox pro Lauf (Abschnitt 6)
|
||||||
- F-05 Runner mit Wiederholungen, Abbruch und Fortsetzen (Abschnitt 7)
|
- F-05 Runner mit Wiederholungen, Abbruch und Fortsetzen (Abschnitt 7)
|
||||||
- F-06 SQLite-Speicherung inkl. Schritt-Log (Abschnitt 8)
|
- F-06 SQLite-Speicherung inkl. Schritt-Log (Abschnitt 8)
|
||||||
- F-07 Tests a-01 bis a-03 und b-04 bis b-06
|
- F-07 Tests a-01 bis a-03 und b-04 bis b-06
|
||||||
|
|||||||
1605
package-lock.json
generated
Normal file
30
package.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "coding-bench",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite dev",
|
||||||
|
"build": "vite build",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"prepare": "svelte-kit sync || echo ''",
|
||||||
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
|
"tauri": "tauri"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@tauri-apps/api": "^2",
|
||||||
|
"@tauri-apps/plugin-opener": "^2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@sveltejs/adapter-static": "^3.0.10",
|
||||||
|
"@sveltejs/kit": "^2.65.1",
|
||||||
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
||||||
|
"svelte": "^5.56.3",
|
||||||
|
"svelte-check": "^4.6.0",
|
||||||
|
"typescript": "~6.0.3",
|
||||||
|
"vite": "^8.0.16",
|
||||||
|
"@tauri-apps/cli": "^2"
|
||||||
|
}
|
||||||
|
}
|
||||||
7
src-tauri/.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Generated by Cargo
|
||||||
|
# will have compiled files and executables
|
||||||
|
/target/
|
||||||
|
|
||||||
|
# Generated by Tauri
|
||||||
|
# will have schema files for capabilities auto-completion
|
||||||
|
/gen/schemas
|
||||||
4819
src-tauri/Cargo.lock
generated
Normal file
34
src-tauri/Cargo.toml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[package]
|
||||||
|
name = "coding-bench"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "A Tauri App"
|
||||||
|
authors = ["you"]
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
# The `_lib` suffix may seem redundant but it is necessary
|
||||||
|
# to make the lib name unique and wouldn't conflict with the bin name.
|
||||||
|
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
||||||
|
name = "coding_bench_lib"
|
||||||
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
tauri-build = { version = "2", features = [] }
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tauri = { version = "2", features = [] }
|
||||||
|
tauri-plugin-opener = "2"
|
||||||
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
serde_json = "1"
|
||||||
|
toml = "0.8"
|
||||||
|
|
||||||
|
|
||||||
|
# Read the optimization guideline for more details: https://tauri.app/concept/size/#cargo-configuration
|
||||||
|
[profile.release]
|
||||||
|
codegen-units = 1
|
||||||
|
lto = true
|
||||||
|
opt-level = 3
|
||||||
|
panic = "abort"
|
||||||
|
strip = true
|
||||||
3
src-tauri/build.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
tauri_build::build()
|
||||||
|
}
|
||||||
10
src-tauri/capabilities/default.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../gen/schemas/desktop-schema.json",
|
||||||
|
"identifier": "default",
|
||||||
|
"description": "Capability for the main window",
|
||||||
|
"windows": ["main"],
|
||||||
|
"permissions": [
|
||||||
|
"core:default",
|
||||||
|
"opener:default"
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
src-tauri/icons/128x128.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src-tauri/icons/128x128@2x.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src-tauri/icons/32x32.png
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
|
After Width: | Height: | Size: 536 B |
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
|
After Width: | Height: | Size: 777 B |
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
|
After Width: | Height: | Size: 1020 B |
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src-tauri/icons/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 848 B |
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
src-tauri/icons/icon.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
138
src-tauri/src/config.rs
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
//! Konfiguration (TOML) und Datenordner (F-01).
|
||||||
|
//!
|
||||||
|
//! Die Datei `config.toml` liegt im App-Konfigurationsordner. Fehlt sie, wird sie
|
||||||
|
//! mit Standardwerten angelegt. Pfade in der Datei sind optional; ohne Angabe
|
||||||
|
//! gilt der Standardordner der App bzw. `<datenordner>/tasks`.
|
||||||
|
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::fs;
|
||||||
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
|
pub const CONFIG_FILE_NAME: &str = "config.toml";
|
||||||
|
|
||||||
|
/// Rohe Konfiguration, so wie sie in der Datei steht.
|
||||||
|
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
|
#[serde(default, deny_unknown_fields)]
|
||||||
|
pub struct Config {
|
||||||
|
/// Datenordner (Ergebnisse, Artefakte, Datenbank). Leer = Standard der App.
|
||||||
|
pub data_dir: Option<PathBuf>,
|
||||||
|
/// Aufgabenordner. Leer = `<datenordner>/tasks`.
|
||||||
|
pub tasks_dir: Option<PathBuf>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Aufgelöste Pfade, die die App tatsächlich verwendet.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
|
pub struct Paths {
|
||||||
|
pub config_file: PathBuf,
|
||||||
|
pub data_dir: PathBuf,
|
||||||
|
pub tasks_dir: PathBuf,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Config {
|
||||||
|
/// Liest die Konfiguration aus einem TOML-Text.
|
||||||
|
pub fn parse(text: &str) -> Result<Config, String> {
|
||||||
|
toml::from_str(text).map_err(|e| format!("config.toml ist ungültig: {e}"))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Löst die Pfade auf. `default_data_dir` ist der Standardordner der App.
|
||||||
|
pub fn resolve(&self, config_file: &Path, default_data_dir: &Path) -> Paths {
|
||||||
|
let data_dir = self
|
||||||
|
.data_dir
|
||||||
|
.clone()
|
||||||
|
.unwrap_or_else(|| default_data_dir.to_path_buf());
|
||||||
|
let tasks_dir = self
|
||||||
|
.tasks_dir
|
||||||
|
.clone()
|
||||||
|
.unwrap_or_else(|| data_dir.join("tasks"));
|
||||||
|
Paths {
|
||||||
|
config_file: config_file.to_path_buf(),
|
||||||
|
data_dir,
|
||||||
|
tasks_dir,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Lädt die Konfiguration aus `config_dir/config.toml`, legt die Datei bei Bedarf
|
||||||
|
/// mit Standardwerten an und stellt sicher, dass der Datenordner existiert.
|
||||||
|
pub fn load_or_create(config_dir: &Path, default_data_dir: &Path) -> Result<Paths, String> {
|
||||||
|
fs::create_dir_all(config_dir)
|
||||||
|
.map_err(|e| format!("Konfigurationsordner {} nicht anlegbar: {e}", config_dir.display()))?;
|
||||||
|
|
||||||
|
let config_file = config_dir.join(CONFIG_FILE_NAME);
|
||||||
|
let config = if config_file.exists() {
|
||||||
|
let text = fs::read_to_string(&config_file)
|
||||||
|
.map_err(|e| format!("{} nicht lesbar: {e}", config_file.display()))?;
|
||||||
|
Config::parse(&text)?
|
||||||
|
} else {
|
||||||
|
let defaults = Config::default();
|
||||||
|
let text = toml::to_string_pretty(&defaults)
|
||||||
|
.map_err(|e| format!("Standard-Config nicht serialisierbar: {e}"))?;
|
||||||
|
fs::write(&config_file, format!("# coding-bench Konfiguration\n{text}"))
|
||||||
|
.map_err(|e| format!("{} nicht schreibbar: {e}", config_file.display()))?;
|
||||||
|
defaults
|
||||||
|
};
|
||||||
|
|
||||||
|
let paths = config.resolve(&config_file, default_data_dir);
|
||||||
|
fs::create_dir_all(&paths.data_dir)
|
||||||
|
.map_err(|e| format!("Datenordner {} nicht anlegbar: {e}", paths.data_dir.display()))?;
|
||||||
|
Ok(paths)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn leere_datei_ergibt_standardwerte() {
|
||||||
|
let c = Config::parse("").unwrap();
|
||||||
|
assert_eq!(c, Config::default());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn pfade_werden_gelesen() {
|
||||||
|
let c = Config::parse("data_dir = \"/x/daten\"\ntasks_dir = \"/x/aufgaben\"\n").unwrap();
|
||||||
|
assert_eq!(c.data_dir, Some(PathBuf::from("/x/daten")));
|
||||||
|
assert_eq!(c.tasks_dir, Some(PathBuf::from("/x/aufgaben")));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn unbekannter_schluessel_ist_fehler() {
|
||||||
|
assert!(Config::parse("unbekannt = 1\n").is_err());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn tasks_standard_liegt_im_datenordner() {
|
||||||
|
let p = Config::default().resolve(Path::new("/c/config.toml"), Path::new("/d"));
|
||||||
|
assert_eq!(p.data_dir, PathBuf::from("/d"));
|
||||||
|
assert_eq!(p.tasks_dir, PathBuf::from("/d/tasks"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn angegebener_datenordner_gilt_auch_fuer_tasks() {
|
||||||
|
let c = Config::parse("data_dir = \"/x\"\n").unwrap();
|
||||||
|
let p = c.resolve(Path::new("/c/config.toml"), Path::new("/d"));
|
||||||
|
assert_eq!(p.data_dir, PathBuf::from("/x"));
|
||||||
|
assert_eq!(p.tasks_dir, PathBuf::from("/x/tasks"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn load_or_create_legt_datei_und_ordner_an() {
|
||||||
|
let base = std::env::temp_dir().join(format!("cb-config-test-{}", std::process::id()));
|
||||||
|
let _ = fs::remove_dir_all(&base);
|
||||||
|
let cfg_dir = base.join("cfg");
|
||||||
|
let data_dir = base.join("data");
|
||||||
|
|
||||||
|
let paths = load_or_create(&cfg_dir, &data_dir).unwrap();
|
||||||
|
assert!(cfg_dir.join(CONFIG_FILE_NAME).exists());
|
||||||
|
assert!(data_dir.is_dir());
|
||||||
|
assert_eq!(paths.tasks_dir, data_dir.join("tasks"));
|
||||||
|
|
||||||
|
// Zweiter Aufruf liest die vorhandene Datei, ohne sie zu verändern.
|
||||||
|
let before = fs::read_to_string(cfg_dir.join(CONFIG_FILE_NAME)).unwrap();
|
||||||
|
load_or_create(&cfg_dir, &data_dir).unwrap();
|
||||||
|
let after = fs::read_to_string(cfg_dir.join(CONFIG_FILE_NAME)).unwrap();
|
||||||
|
assert_eq!(before, after);
|
||||||
|
|
||||||
|
let _ = fs::remove_dir_all(&base);
|
||||||
|
}
|
||||||
|
}
|
||||||
40
src-tauri/src/lib.rs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
mod config;
|
||||||
|
mod tasks;
|
||||||
|
|
||||||
|
use config::Paths;
|
||||||
|
use tauri::{Manager, State};
|
||||||
|
|
||||||
|
/// Aufgelöste Pfade, einmal beim Start ermittelt.
|
||||||
|
pub struct AppPaths(pub Paths);
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
fn get_paths(paths: State<'_, AppPaths>) -> Paths {
|
||||||
|
paths.0.clone()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
fn load_tasks(paths: State<'_, AppPaths>) -> tasks::LoadReport {
|
||||||
|
tasks::load_all(&paths.0.tasks_dir)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
|
pub fn run() {
|
||||||
|
tauri::Builder::default()
|
||||||
|
.plugin(tauri_plugin_opener::init())
|
||||||
|
.setup(|app| {
|
||||||
|
let config_dir = app
|
||||||
|
.path()
|
||||||
|
.app_config_dir()
|
||||||
|
.map_err(|e| format!("Konfigurationsordner nicht ermittelbar: {e}"))?;
|
||||||
|
let default_data_dir = app
|
||||||
|
.path()
|
||||||
|
.app_data_dir()
|
||||||
|
.map_err(|e| format!("Datenordner nicht ermittelbar: {e}"))?;
|
||||||
|
let paths = config::load_or_create(&config_dir, &default_data_dir)?;
|
||||||
|
app.manage(AppPaths(paths));
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
.invoke_handler(tauri::generate_handler![get_paths, load_tasks])
|
||||||
|
.run(tauri::generate_context!())
|
||||||
|
.expect("error while running tauri application");
|
||||||
|
}
|
||||||
6
src-tauri/src/main.rs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||||
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
coding_bench_lib::run()
|
||||||
|
}
|
||||||
302
src-tauri/src/tasks.rs
Normal file
@ -0,0 +1,302 @@
|
|||||||
|
//! Aufgaben laden und validieren (F-02, SPEC Abschnitt 4).
|
||||||
|
//!
|
||||||
|
//! Eine Aufgabe ist ein Ordner `tasks/<gruppe>/<name>/` mit `task.toml`,
|
||||||
|
//! `prompt.md`, `check.sh` und `start/`. Fehlerhafte Aufgaben werden nicht
|
||||||
|
//! geladen, sondern mit Pfad und Grund gemeldet.
|
||||||
|
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::fs;
|
||||||
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
|
pub const TASK_FILE: &str = "task.toml";
|
||||||
|
pub const PROMPT_FILE: &str = "prompt.md";
|
||||||
|
pub const CHECK_FILE: &str = "check.sh";
|
||||||
|
pub const START_DIR: &str = "start";
|
||||||
|
|
||||||
|
const GROUPS: [&str; 4] = ["A", "B", "C", "D"];
|
||||||
|
|
||||||
|
/// Metadaten aus `task.toml`.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
|
pub struct TaskToml {
|
||||||
|
pub id: String,
|
||||||
|
pub title: String,
|
||||||
|
pub group: String,
|
||||||
|
#[serde(default = "default_weight")]
|
||||||
|
pub weight: f64,
|
||||||
|
pub image: String,
|
||||||
|
pub max_steps: u32,
|
||||||
|
pub timeout_s: u64,
|
||||||
|
#[serde(default = "default_check_timeout")]
|
||||||
|
pub check_timeout_s: u64,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn default_weight() -> f64 {
|
||||||
|
1.0
|
||||||
|
}
|
||||||
|
|
||||||
|
fn default_check_timeout() -> u64 {
|
||||||
|
120
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Eine geladene, gültige Aufgabe.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
|
pub struct Task {
|
||||||
|
#[serde(flatten)]
|
||||||
|
pub meta: TaskToml,
|
||||||
|
pub dir: PathBuf,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Ein Fehler bei einer Aufgabe, mit Ordner und Grund.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
|
pub struct TaskError {
|
||||||
|
pub dir: PathBuf,
|
||||||
|
pub message: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Ergebnis eines Ladelaufs.
|
||||||
|
#[derive(Debug, Default, Clone, PartialEq, Serialize)]
|
||||||
|
pub struct LoadReport {
|
||||||
|
pub tasks: Vec<Task>,
|
||||||
|
pub errors: Vec<TaskError>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Validiert die Metadaten. Gibt eine Liste aller Verstöße zurück.
|
||||||
|
pub fn validate_meta(meta: &TaskToml) -> Vec<String> {
|
||||||
|
let mut errs = Vec::new();
|
||||||
|
if meta.id.trim().is_empty() {
|
||||||
|
errs.push("id ist leer".into());
|
||||||
|
}
|
||||||
|
if meta.title.trim().is_empty() {
|
||||||
|
errs.push("title ist leer".into());
|
||||||
|
}
|
||||||
|
if !GROUPS.contains(&meta.group.as_str()) {
|
||||||
|
errs.push(format!("group muss A, B, C oder D sein, ist {:?}", meta.group));
|
||||||
|
}
|
||||||
|
if !meta.weight.is_finite() || meta.weight <= 0.0 {
|
||||||
|
errs.push("weight muss größer als 0 sein".into());
|
||||||
|
}
|
||||||
|
if meta.image.trim().is_empty() {
|
||||||
|
errs.push("image ist leer".into());
|
||||||
|
}
|
||||||
|
if meta.max_steps == 0 {
|
||||||
|
errs.push("max_steps muss größer als 0 sein".into());
|
||||||
|
}
|
||||||
|
if meta.timeout_s == 0 {
|
||||||
|
errs.push("timeout_s muss größer als 0 sein".into());
|
||||||
|
}
|
||||||
|
if meta.check_timeout_s == 0 {
|
||||||
|
errs.push("check_timeout_s muss größer als 0 sein".into());
|
||||||
|
}
|
||||||
|
errs
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Prüft die Pflichtdateien und Rechte eines Aufgabenordners.
|
||||||
|
pub fn validate_files(dir: &Path) -> Vec<String> {
|
||||||
|
let mut errs = Vec::new();
|
||||||
|
for name in [TASK_FILE, PROMPT_FILE, CHECK_FILE] {
|
||||||
|
if !dir.join(name).is_file() {
|
||||||
|
errs.push(format!("Pflichtdatei fehlt: {name}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !dir.join(START_DIR).is_dir() {
|
||||||
|
errs.push(format!("Ordner fehlt: {START_DIR}/ (darf leer sein)"));
|
||||||
|
}
|
||||||
|
if dir.join(CHECK_FILE).is_file() && !is_executable(&dir.join(CHECK_FILE)) {
|
||||||
|
errs.push(format!("{CHECK_FILE} ist nicht ausführbar"));
|
||||||
|
}
|
||||||
|
errs
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
fn is_executable(path: &Path) -> bool {
|
||||||
|
use std::os::unix::fs::PermissionsExt;
|
||||||
|
fs::metadata(path)
|
||||||
|
.map(|m| m.permissions().mode() & 0o111 != 0)
|
||||||
|
.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(unix))]
|
||||||
|
fn is_executable(_path: &Path) -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Lädt eine einzelne Aufgabe aus ihrem Ordner.
|
||||||
|
pub fn load_one(dir: &Path) -> Result<Task, Vec<String>> {
|
||||||
|
let mut errs = validate_files(dir);
|
||||||
|
|
||||||
|
let meta = match fs::read_to_string(dir.join(TASK_FILE)) {
|
||||||
|
Ok(text) => match toml::from_str::<TaskToml>(&text) {
|
||||||
|
Ok(meta) => {
|
||||||
|
errs.extend(validate_meta(&meta));
|
||||||
|
Some(meta)
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
errs.push(format!("{TASK_FILE} ist kein gültiges TOML: {e}"));
|
||||||
|
None
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Err(_) => None, // Fehlende Datei ist oben schon gemeldet.
|
||||||
|
};
|
||||||
|
|
||||||
|
match (meta, errs.is_empty()) {
|
||||||
|
(Some(meta), true) => Ok(Task {
|
||||||
|
meta,
|
||||||
|
dir: dir.to_path_buf(),
|
||||||
|
}),
|
||||||
|
_ => Err(errs),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Lädt alle Aufgaben unterhalb von `tasks_dir` (Ebene `<gruppe>/<name>`).
|
||||||
|
/// Ein fehlender Aufgabenordner ist kein Fehler: es gibt dann keine Aufgaben.
|
||||||
|
pub fn load_all(tasks_dir: &Path) -> LoadReport {
|
||||||
|
let mut report = LoadReport::default();
|
||||||
|
if !tasks_dir.is_dir() {
|
||||||
|
return report;
|
||||||
|
}
|
||||||
|
|
||||||
|
let groups = match sorted_subdirs(tasks_dir) {
|
||||||
|
Ok(v) => v,
|
||||||
|
Err(e) => {
|
||||||
|
report.errors.push(TaskError {
|
||||||
|
dir: tasks_dir.to_path_buf(),
|
||||||
|
message: format!("Aufgabenordner nicht lesbar: {e}"),
|
||||||
|
});
|
||||||
|
return report;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for group_dir in groups {
|
||||||
|
match sorted_subdirs(&group_dir) {
|
||||||
|
Ok(tasks) => {
|
||||||
|
for task_dir in tasks {
|
||||||
|
match load_one(&task_dir) {
|
||||||
|
Ok(task) => report.tasks.push(task),
|
||||||
|
Err(messages) => report.errors.push(TaskError {
|
||||||
|
dir: task_dir,
|
||||||
|
message: messages.join("; "),
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(e) => report.errors.push(TaskError {
|
||||||
|
dir: group_dir,
|
||||||
|
message: format!("Gruppenordner nicht lesbar: {e}"),
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
report
|
||||||
|
}
|
||||||
|
|
||||||
|
fn sorted_subdirs(dir: &Path) -> std::io::Result<Vec<PathBuf>> {
|
||||||
|
let mut out: Vec<PathBuf> = fs::read_dir(dir)?
|
||||||
|
.filter_map(|e| e.ok())
|
||||||
|
.map(|e| e.path())
|
||||||
|
.filter(|p| p.is_dir())
|
||||||
|
.collect();
|
||||||
|
out.sort();
|
||||||
|
Ok(out)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
const GUT: &str = r#"
|
||||||
|
id = "b-05-bugfix-parser"
|
||||||
|
title = "Bug im Parser finden und fixen"
|
||||||
|
group = "B"
|
||||||
|
image = "cb-python:latest"
|
||||||
|
max_steps = 25
|
||||||
|
timeout_s = 600
|
||||||
|
"#;
|
||||||
|
|
||||||
|
fn tmp(name: &str) -> PathBuf {
|
||||||
|
let p = std::env::temp_dir().join(format!("cb-tasks-{}-{}", name, std::process::id()));
|
||||||
|
let _ = fs::remove_dir_all(&p);
|
||||||
|
fs::create_dir_all(&p).unwrap();
|
||||||
|
p
|
||||||
|
}
|
||||||
|
|
||||||
|
fn make_task(dir: &Path, toml: &str, check_exec: bool) {
|
||||||
|
fs::create_dir_all(dir.join(START_DIR)).unwrap();
|
||||||
|
fs::write(dir.join(TASK_FILE), toml).unwrap();
|
||||||
|
fs::write(dir.join(PROMPT_FILE), "Aufgabe").unwrap();
|
||||||
|
fs::write(dir.join(CHECK_FILE), "#!/bin/sh\nexit 0\n").unwrap();
|
||||||
|
#[cfg(unix)]
|
||||||
|
{
|
||||||
|
use std::os::unix::fs::PermissionsExt;
|
||||||
|
let mode = if check_exec { 0o755 } else { 0o644 };
|
||||||
|
fs::set_permissions(dir.join(CHECK_FILE), fs::Permissions::from_mode(mode)).unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn gueltige_aufgabe_wird_geladen() {
|
||||||
|
let base = tmp("gut");
|
||||||
|
let dir = base.join("B").join("b-05");
|
||||||
|
make_task(&dir, GUT, true);
|
||||||
|
let task = load_one(&dir).unwrap();
|
||||||
|
assert_eq!(task.meta.id, "b-05-bugfix-parser");
|
||||||
|
assert_eq!(task.meta.weight, 1.0);
|
||||||
|
assert_eq!(task.meta.check_timeout_s, 120);
|
||||||
|
let _ = fs::remove_dir_all(&base);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fehlende_pflichtdatei_wird_gemeldet() {
|
||||||
|
let base = tmp("fehlt");
|
||||||
|
let dir = base.join("A").join("a-01");
|
||||||
|
make_task(&dir, GUT, true);
|
||||||
|
fs::remove_file(dir.join(CHECK_FILE)).unwrap();
|
||||||
|
let errs = load_one(&dir).unwrap_err();
|
||||||
|
assert!(errs.iter().any(|e| e.contains("check.sh")));
|
||||||
|
let _ = fs::remove_dir_all(&base);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn check_sh_ohne_ausfuehrungsrecht_wird_gemeldet() {
|
||||||
|
let base = tmp("exec");
|
||||||
|
let dir = base.join("A").join("a-01");
|
||||||
|
make_task(&dir, GUT, false);
|
||||||
|
let errs = load_one(&dir).unwrap_err();
|
||||||
|
assert!(errs.iter().any(|e| e.contains("nicht ausführbar")));
|
||||||
|
let _ = fs::remove_dir_all(&base);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn ungueltige_gruppe_und_unbekannter_schluessel() {
|
||||||
|
let base = tmp("toml");
|
||||||
|
let dir = base.join("X").join("x-01");
|
||||||
|
let toml = GUT.replace("group = \"B\"", "group = \"Z\"") + "unbekannt = 1\n";
|
||||||
|
make_task(&dir, &toml, true);
|
||||||
|
let errs = load_one(&dir).unwrap_err();
|
||||||
|
assert!(errs.iter().any(|e| e.contains("unbekannt") || e.contains("kein gültiges TOML")));
|
||||||
|
let _ = fs::remove_dir_all(&base);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn ungueltige_zahlen_werden_gemeldet() {
|
||||||
|
let meta: TaskToml = toml::from_str(&GUT.replace("max_steps = 25", "max_steps = 0")).unwrap();
|
||||||
|
assert!(validate_meta(&meta).iter().any(|e| e.contains("max_steps")));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn load_all_trennt_gute_und_schlechte_aufgaben() {
|
||||||
|
let base = tmp("all");
|
||||||
|
make_task(&base.join("B").join("b-05"), GUT, true);
|
||||||
|
fs::create_dir_all(base.join("A").join("a-01")).unwrap(); // leer, also kaputt
|
||||||
|
let report = load_all(&base);
|
||||||
|
assert_eq!(report.tasks.len(), 1);
|
||||||
|
assert_eq!(report.errors.len(), 1);
|
||||||
|
assert!(report.errors[0].dir.ends_with("a-01"));
|
||||||
|
let _ = fs::remove_dir_all(&base);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fehlender_aufgabenordner_ist_leer_nicht_fehler() {
|
||||||
|
let report = load_all(Path::new("/gibt/es/nicht/cb-test"));
|
||||||
|
assert!(report.tasks.is_empty() && report.errors.is_empty());
|
||||||
|
}
|
||||||
|
}
|
||||||
35
src-tauri/tauri.conf.json
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
|
"productName": "coding-bench",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"identifier": "org.wlkns.codingbench",
|
||||||
|
"build": {
|
||||||
|
"beforeDevCommand": "npm run dev",
|
||||||
|
"devUrl": "http://localhost:1420",
|
||||||
|
"beforeBuildCommand": "npm run build",
|
||||||
|
"frontendDist": "../build"
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"windows": [
|
||||||
|
{
|
||||||
|
"title": "coding-bench",
|
||||||
|
"width": 800,
|
||||||
|
"height": 600
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": {
|
||||||
|
"csp": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bundle": {
|
||||||
|
"active": true,
|
||||||
|
"targets": "all",
|
||||||
|
"icon": [
|
||||||
|
"icons/32x32.png",
|
||||||
|
"icons/128x128.png",
|
||||||
|
"icons/128x128@2x.png",
|
||||||
|
"icons/icon.icns",
|
||||||
|
"icons/icon.ico"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/app.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>Tauri + SvelteKit + Typescript App</title>
|
||||||
|
%sveltekit.head%
|
||||||
|
</head>
|
||||||
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
5
src/routes/+layout.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// Tauri doesn't have a Node.js server to do proper SSR
|
||||||
|
// so we use adapter-static with a fallback to index.html to put the site in SPA mode
|
||||||
|
// See: https://svelte.dev/docs/kit/single-page-apps
|
||||||
|
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
|
||||||
|
export const ssr = false;
|
||||||
121
src/routes/+page.svelte
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
import { invoke } from "@tauri-apps/api/core";
|
||||||
|
|
||||||
|
type Paths = {
|
||||||
|
config_file: string;
|
||||||
|
data_dir: string;
|
||||||
|
tasks_dir: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type TaskInfo = { id: string; title: string; group: string; dir: string };
|
||||||
|
type TaskError = { dir: string; message: string };
|
||||||
|
type LoadReport = { tasks: TaskInfo[]; errors: TaskError[] };
|
||||||
|
|
||||||
|
let paths = $state<Paths | null>(null);
|
||||||
|
let error = $state("");
|
||||||
|
let report = $state<LoadReport | null>(null);
|
||||||
|
let taskError = $state("");
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
try {
|
||||||
|
paths = await invoke<Paths>("get_paths");
|
||||||
|
} catch (e) {
|
||||||
|
error = String(e);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
report = await invoke<LoadReport>("load_tasks");
|
||||||
|
} catch (e) {
|
||||||
|
taskError = String(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<main class="container">
|
||||||
|
<h1>coding-bench</h1>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>Setup: Pfade</h2>
|
||||||
|
{#if error}
|
||||||
|
<p class="fehler">Fehler: {error}</p>
|
||||||
|
{:else if paths}
|
||||||
|
<dl>
|
||||||
|
<dt>Konfiguration</dt>
|
||||||
|
<dd><code>{paths.config_file}</code></dd>
|
||||||
|
<dt>Datenordner</dt>
|
||||||
|
<dd><code>{paths.data_dir}</code></dd>
|
||||||
|
<dt>Aufgabenordner</dt>
|
||||||
|
<dd><code>{paths.tasks_dir}</code></dd>
|
||||||
|
</dl>
|
||||||
|
{:else}
|
||||||
|
<p>Lade Pfade …</p>
|
||||||
|
{/if}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>Aufgaben</h2>
|
||||||
|
{#if taskError}
|
||||||
|
<p class="fehler">Fehler: {taskError}</p>
|
||||||
|
{:else if report}
|
||||||
|
<p>{report.tasks.length} gültig, {report.errors.length} mit Fehlern.</p>
|
||||||
|
<ul>
|
||||||
|
{#each report.tasks as t (t.dir)}
|
||||||
|
<li><strong>{t.id}</strong> · {t.title} <span class="gruppe">Gruppe {t.group}</span></li>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
|
{#if report.errors.length > 0}
|
||||||
|
<h3>Fehler</h3>
|
||||||
|
<ul class="fehler">
|
||||||
|
{#each report.errors as e (e.dir)}
|
||||||
|
<li><code>{e.dir}</code>: {e.message}</li>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
|
{/if}
|
||||||
|
{:else}
|
||||||
|
<p>Lade Aufgaben …</p>
|
||||||
|
{/if}
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #0f0f0f;
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root {
|
||||||
|
color: #f6f6f6;
|
||||||
|
background-color: #2f2f2f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 2rem 1rem;
|
||||||
|
max-width: 48rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: max-content 1fr;
|
||||||
|
gap: 0.4rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
dt {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
margin: 0;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fehler {
|
||||||
|
color: #c62828;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
BIN
static/favicon.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
1
static/svelte.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="26.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 308"><path fill="#FF3E00" d="M239.682 40.707C211.113-.182 154.69-12.301 113.895 13.69L42.247 59.356a82.198 82.198 0 0 0-37.135 55.056a86.566 86.566 0 0 0 8.536 55.576a82.425 82.425 0 0 0-12.296 30.719a87.596 87.596 0 0 0 14.964 66.244c28.574 40.893 84.997 53.007 125.787 27.016l71.648-45.664a82.182 82.182 0 0 0 37.135-55.057a86.601 86.601 0 0 0-8.53-55.577a82.409 82.409 0 0 0 12.29-30.718a87.573 87.573 0 0 0-14.963-66.244"></path><path fill="#FFF" d="M106.889 270.841c-23.102 6.007-47.497-3.036-61.103-22.648a52.685 52.685 0 0 1-9.003-39.85a49.978 49.978 0 0 1 1.713-6.693l1.35-4.115l3.671 2.697a92.447 92.447 0 0 0 28.036 14.007l2.663.808l-.245 2.659a16.067 16.067 0 0 0 2.89 10.656a17.143 17.143 0 0 0 18.397 6.828a15.786 15.786 0 0 0 4.403-1.935l71.67-45.672a14.922 14.922 0 0 0 6.734-9.977a15.923 15.923 0 0 0-2.713-12.011a17.156 17.156 0 0 0-18.404-6.832a15.78 15.78 0 0 0-4.396 1.933l-27.35 17.434a52.298 52.298 0 0 1-14.553 6.391c-23.101 6.007-47.497-3.036-61.101-22.649a52.681 52.681 0 0 1-9.004-39.849a49.428 49.428 0 0 1 22.34-33.114l71.664-45.677a52.218 52.218 0 0 1 14.563-6.398c23.101-6.007 47.497 3.036 61.101 22.648a52.685 52.685 0 0 1 9.004 39.85a50.559 50.559 0 0 1-1.713 6.692l-1.35 4.116l-3.67-2.693a92.373 92.373 0 0 0-28.037-14.013l-2.664-.809l.246-2.658a16.099 16.099 0 0 0-2.89-10.656a17.143 17.143 0 0 0-18.398-6.828a15.786 15.786 0 0 0-4.402 1.935l-71.67 45.674a14.898 14.898 0 0 0-6.73 9.975a15.9 15.9 0 0 0 2.709 12.012a17.156 17.156 0 0 0 18.404 6.832a15.841 15.841 0 0 0 4.402-1.935l27.345-17.427a52.147 52.147 0 0 1 14.552-6.397c23.101-6.006 47.497 3.037 61.102 22.65a52.681 52.681 0 0 1 9.003 39.848a49.453 49.453 0 0 1-22.34 33.12l-71.664 45.673a52.218 52.218 0 0 1-14.563 6.398"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.9 KiB |
6
static/tauri.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
|
||||||
|
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
1
static/vite.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
18
svelte.config.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// Tauri doesn't have a Node.js server to do proper SSR
|
||||||
|
// so we use adapter-static with a fallback to index.html to put the site in SPA mode
|
||||||
|
// See: https://svelte.dev/docs/kit/single-page-apps
|
||||||
|
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
|
||||||
|
import adapter from "@sveltejs/adapter-static";
|
||||||
|
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
||||||
|
|
||||||
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
|
const config = {
|
||||||
|
preprocess: vitePreprocess(),
|
||||||
|
kit: {
|
||||||
|
adapter: adapter({
|
||||||
|
fallback: "index.html",
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
19
tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"extends": "./.svelte-kit/tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"checkJs": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"strict": true,
|
||||||
|
"moduleResolution": "bundler"
|
||||||
|
}
|
||||||
|
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
||||||
|
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
||||||
|
//
|
||||||
|
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
||||||
|
// from the referenced tsconfig.json - TypeScript does not merge them in
|
||||||
|
}
|
||||||
32
vite.config.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import { defineConfig } from "vite";
|
||||||
|
import { sveltekit } from "@sveltejs/kit/vite";
|
||||||
|
// @ts-expect-error type error without @types/node package
|
||||||
|
import process from "node:process";
|
||||||
|
const host = process.env.TAURI_DEV_HOST;
|
||||||
|
|
||||||
|
// https://vite.dev/config/
|
||||||
|
export default defineConfig(() => ({
|
||||||
|
plugins: [sveltekit()],
|
||||||
|
|
||||||
|
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
||||||
|
//
|
||||||
|
// 1. prevent Vite from obscuring rust errors
|
||||||
|
clearScreen: false,
|
||||||
|
// 2. tauri expects a fixed port, fail if that port is not available
|
||||||
|
server: {
|
||||||
|
port: 1420,
|
||||||
|
strictPort: true,
|
||||||
|
host: host || "127.0.0.1",
|
||||||
|
hmr: host
|
||||||
|
? {
|
||||||
|
protocol: "ws",
|
||||||
|
host,
|
||||||
|
port: 1421,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
watch: {
|
||||||
|
// 3. tell Vite to ignore watching `src-tauri`
|
||||||
|
ignored: ["**/src-tauri/**"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}));
|
||||||