diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b228a29 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Go-Binaries +/talk +/talkd +/talk.exe +/talkd.exe +*.test +*.out + +# Release-Artefakte (GoReleaser, Task 11) +/dist/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9648317 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 m3tam3re + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c5248b4 --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# talk + +> **Status: WIP** — aktive Entwicklung (talk 2.0). Binde Spezifikation: +> [`.scratch/talk-2-0/spec.md`](.scratch/talk-2-0/spec.md) · +> Implementierungsplan: [`.scratch/talk-2-0/plan.md`](.scratch/talk-2-0/plan.md) + +**talk** macht Skripte und KI-Agenten hörbar: Ein Aufruf — `talk "Build fertig"` — +spricht eine kurze Nachricht über eine TTS-Provider-Kette +(ElevenLabs → OpenAI → Edge-TTS → OS-Stimme), serialisiert durch den Daemon +`talkd`. Cross-platform (Windows/macOS/Linux, amd64/arm64), statische Binaries, +keine Runtime-Abhängigkeiten. + +## Befehle + +| Befehl | Zweck | +| --- | --- | +| `talk "Text"` | Ansage — Abkürzung für `talk say`, non-blocking | +| `talk say "Text"` | Ansage (Text als Argument oder von stdin) | +| `talk wrap -- ` | Befehl ausführen, Erfolg/Misserfolg + Dauer ansagen | +| `talk mute` / `talk unmute` | Ansagen dauerhaft stummschalten / Stummschaltung aufheben | +| `talk status` | Daemon-Status (Queue, Mute, Provider, Version) | +| `talk cancel` | laufende und geplante Ansagen abbrechen | +| `talk voices` | verfügbare Stimmen anzeigen | +| `talk test` | Test-Ansage ausgeben | +| `talk doctor` | Selbstdiagnose des Setups | +| `talk setup` | geführte Ersteinrichtung (Wizard) | + +Say-Flags (gelten auch für `talk "Text"`): `--wait`, `--now`, `--priority`, +`--voice`, `--lang`, `--provider`. + +**Hinweis:** Alle Befehle sind in diesem Stand Stubs und melden +`not implemented yet` (Exit-Code ≠ 0). Die Implementierung entsteht +Aufgabenweise gemäß Plan; `--version` und `--help` funktionieren. + +## Entwicklung + +```console +go build ./... # bauen +go test ./... # Tests +go vet ./... # statische Analyse +gofmt -l . # Formatierung prüfen (leerer Output = ok) +``` + +CI: `.gitea/workflows/test.yml` (Gitea Actions) läuft vet, gofmt-Check, Tests +und Build bei jedem Push und Pull Request. + +## Lizenz + +MIT — siehe [LICENSE](LICENSE). diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..6a98238 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module code.m3ta.dev/m3tam3re/talk + +go 1.26.8 diff --git a/internal/api/doc.go b/internal/api/doc.go new file mode 100644 index 0000000..6a787b5 --- /dev/null +++ b/internal/api/doc.go @@ -0,0 +1,4 @@ +// Package api implementiert die HTTP-Oberfläche des Daemons auf 127.0.0.1: +// POST /speak, GET /status, POST /cancel, POST /mute, POST /unmute (Task 04), +// CORS für /speak und den MCP-Endpoint (Streamable HTTP, Task 06). +package api diff --git a/internal/audio/doc.go b/internal/audio/doc.go new file mode 100644 index 0000000..bcfda0f --- /dev/null +++ b/internal/audio/doc.go @@ -0,0 +1,5 @@ +// Package audio implementiert die Audio-Ausgabe von talk über das +// Sink-Interface: Playback embedded via oto (PCM/WAV) und ein null-Sink, +// das verwirft (CI, Server, Tests). Auswahl per Config audio.sink. +// Implementierung folgt in Task 02. +package audio diff --git a/internal/config/doc.go b/internal/config/doc.go new file mode 100644 index 0000000..2a8f008 --- /dev/null +++ b/internal/config/doc.go @@ -0,0 +1,7 @@ +// Package config implementiert die Config-Auflösung von talk: Defaults + +// optionale config.toml im platform-nativen Verzeichnis (~/.config/talk, +// ~/Library/Application Support/talk, %APPDATA%\talk) + Env-Overrides +// (TALK_*); Env schlägt Datei. Enthält Voice-Mapping voice.. +// und Provider-Endpunkte (Fake-bar für Tests). Implementierung folgt in +// Task 02. +package config diff --git a/internal/langdetect/doc.go b/internal/langdetect/doc.go new file mode 100644 index 0000000..fe56788 --- /dev/null +++ b/internal/langdetect/doc.go @@ -0,0 +1,4 @@ +// Package langdetect erkennt die Sprache eines Ansage-Texts als reine +// Funktion Detect(text) → "de" | "en" (Default "de"; Heuristik über +// Common-Word-Listen und Umlaute/ß). Implementierung folgt in Task 02. +package langdetect diff --git a/internal/notify/doc.go b/internal/notify/doc.go new file mode 100644 index 0000000..5c993e0 --- /dev/null +++ b/internal/notify/doc.go @@ -0,0 +1,4 @@ +// Package notify implementiert Best-effort-Desktop-Notifications parallel +// zum Audio (beeep: notify-send / macOS Notification Center / Windows Toast), +// mit Abbrechen-Button, wo das OS ihn hergibt. Implementierung folgt. +package notify diff --git a/internal/provider/doc.go b/internal/provider/doc.go new file mode 100644 index 0000000..6365d28 --- /dev/null +++ b/internal/provider/doc.go @@ -0,0 +1,6 @@ +// Package provider implementiert die TTS-Provider-Kette von talk: +// ElevenLabs → OpenAI TTS → Edge-TTS → OS built-in (macOS say, Windows SAPI, +// Linux espeak/speech-dispatcher), überschreibbar per Config/Flag, mit +// Fallback bei Fehlern. Implementierung folgt in Task 02 (osbuiltin) und +// Task 03 (Cloud-Provider, Kette). +package provider diff --git a/internal/queue/doc.go b/internal/queue/doc.go new file mode 100644 index 0000000..5b75367 --- /dev/null +++ b/internal/queue/doc.go @@ -0,0 +1,6 @@ +// Package queue implementiert die Ansage-Queue des Daemons: serialisierte +// Abarbeitung (eine Ansage gleichzeitig), Prioritäten (high > normal > low, +// FIFO je Level), now-Items springen vor, Rate-Limit mit prioritätsbewusstem +// Verwerfen. Implementierung folgt in Task 04 (Queue) und Task 05 +// (Rate-Limit, Ruhezeiten). +package queue