diff --git a/README.md b/README.md index 3350dde..3a9d4bc 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,11 @@ The script will: 3. Install **Zsh completions** to `/usr/share/zsh/site-functions/`. 4. Install and enable the `toak.service` systemd user service so the background daemon runs automatically. +To remove Toak from your system, simply run: +```bash +./uninstall.sh +``` + --- ## 🎮 Usage @@ -54,6 +59,7 @@ The script will: - **`toak latency-test`**: Benchmarks your network and API latency to ensure optimal performance. - **`toak show`**: Displays your current configuration in a clean table. - **`toak config `**: Quickly update a specific setting (e.g., `toak config whisper whisper-large-v3-turbo`). +- **`toak skill`**: Manage dynamic JSON skills via `list`, `add`, or `remove` subcommands. ### Flags @@ -65,14 +71,27 @@ The script will: ## 🤖 Skills System -Toak includes a modular skills system triggered by saying the **"System"** hotword at the start of your dictation. +Toak includes a robust, data-driven skills system triggered by saying hotwords (like **"System"**) at the start of your dictation. Skills are defined as simple JSON files entirely configurable without modifying the C# codebase. -| Skill | Hotwords | Description | -| :--- | :--- | :--- | -| **Terminal** | "System terminal", "System run" | Executes the spoken command in your shell. | -| **Translate** | "System translate to [language]" | Translates your dictation into the target language. | -| **Professional**| "System professional", "System formalize" | Rewrites your text to be articulate and formal. | -| **Summary** | "System summary", "System concise" | Strips fluff and provides a direct, crisp summary. | +At runtime, skills are loaded from `~/.config/toak/skills/`. + +### Default Skills +| Skill | Hotwords | Description | Type | +| :--- | :--- | :--- | :--- | +| **Terminal** | "System terminal", "System run" | Passes the command to `terminal_action.sh` to execute the spoken shell command. | `script` | +| **Translate** | "System translate to [language]" | Translates your dictation into the target language. | `type` | +| **Professional**| "System professional", "System formalize" | Rewrites your text to be articulate and formal. | `type` | +| **Summary** | "System summary", "System concise" | Strips fluff and provides a direct, crisp summary. | `type` | + +### Customizing & Adding Skills +You can build infinite capabilities using the CLI wizard: +```bash +toak skill add +``` + +This generates a JSON file in `~/.config/toak/skills/`. Skills support two actions: +1. **`type` Action**: Transforms the dictated text via a custom System Prompt and types it into the active window (or pipes/copies if flags are requested). +2. **`script` Action**: Transforms the text and passes the result as `$1` to a local shell script, allowing Toak to control system functions, APIs, or smart home devices completely autonomously. --- diff --git a/docs/STRUCTURE.md b/docs/STRUCTURE.md index f0a7983..e091039 100644 --- a/docs/STRUCTURE.md +++ b/docs/STRUCTURE.md @@ -22,6 +22,7 @@ Toak/ │ ├── OnboardCommand.cs # Initial interactive configuration setup │ ├── ConfigUpdaterCommand.cs # Direct configuration modifications │ ├── ShowCommand.cs # Display current configuration +│ ├── SkillCommand.cs # CLI controller for discovering and adding Dynamic JSON Skills │ └── LatencyTestCommand.cs # Benchmark tool for API calls ├── Configuration/ │ ├── ConfigManager.cs # Loads and saves JSON configuration from the user's home folder @@ -31,7 +32,10 @@ Toak/ │ ├── Logger.cs # Logging utility (verbose logging) │ ├── PromptBuilder.cs # Constructs the system prompts for the LLM based on user settings │ ├── StateTracker.cs # Tracks the current application state (e.g. is recording active?) -│ └── Skills/ # Modular capabilities (e.g., Terminal mode, Language Translation) +│ └── Skills/ # Data-driven JSON skill integrations +│ ├── SkillDefinition.cs # JSON Model +│ ├── DynamicSkill.cs # Runtime implementation mapping LLM context to actions +│ └── SkillRegistry.cs # Loads and detects skills from ~/.config/toak/skills/ ├── IO/ │ ├── ClipboardManager.cs # Cross-session (Wayland/X11) clipboard manipulation (`wl-copy`, `xclip`) │ ├── TextInjector.cs # Native keyboard injection handling (`wtype`, `xdotool`) @@ -40,6 +44,7 @@ Toak/ │ └── AppJsonSerializerContext.cs # System.Text.Json source generation context for AOT support ├── docs/ # Documentation ├── toak.service # systemd user service file to run the daemon automatically +├── uninstall.sh # Script to completely remove daemon, service, and binaries └── Program.cs # Application entry point using System.CommandLine ```