This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
MindWork AI Studio is a cross-platform desktop application for interacting with Large Language Models (LLMs). The app uses a hybrid architecture combining a Rust Tauri runtime (for the native desktop shell) with a .NET Blazor Server web application (for the UI and business logic).
**Key Architecture Points:**
- **Runtime:** Rust-based Tauri v1.8 application providing the native window, system integration, and IPC layer
- **App:** .NET 9 Blazor Server application providing the UI and core functionality
- **Communication:** The Rust runtime and .NET app communicate via HTTPS with TLS certificates generated at startup
- Prefer `cd app/Build && dotnet run build` for repo builds. This is the canonical build flow for the .NET sidecar in this project.
- If a direct `dotnet` command is required, always quote paths with spaces and prefer live-progress output such as `-v normal` instead of `-v minimal`.
- Run .NET builds as a long-lived or polled command session instead of a single short command invocation that may be cut off by an output timeout.
- Use `--no-restore` when dependencies are already restored. Treat restore failures separately from compile failures, because restore/network issues may come from the agent sandbox rather than the project itself.
- **Tools/Rust/** - .NET wrapper for Rust API calls
- **Settings/** - Application settings and data models
- **Components/** - Reusable Blazor components
- **Pages/** - Top-level page components
### IPC Communication Flow
1. Rust runtime starts and generates TLS certificate
2. Rust starts internal HTTPS API on random port
3. Rust launches .NET sidecar, passing: API port, certificate fingerprint, API token, secret key
4. .NET reads environment variables and establishes secure HTTPS connection to Rust
5. .NET requests an app port from Rust, starts Blazor Server on that port
6. Rust opens Tauri webview pointing to localhost:app_port
7. Bi-directional communication: .NET ↔ Rust via HTTPS API
### Configuration and Metadata
-`metadata.txt` - Build metadata (version, build time, component versions) read by both Rust and .NET
-`startup.env` - Development environment variables (generated by build script)
-`.NET project` reads metadata.txt at build time and injects as assembly attributes
## Plugin System
**Location:** `app/MindWork AI Studio/Plugins/`
Plugins are written in Lua and provide:
- **Language plugins** - I18N translations (e.g., German language pack)
- **Configuration plugins** - Enterprise IT configurations for centrally managed providers, settings
- **Future:** Assistant plugins for custom assistants
**Example configuration plugin:** `app/MindWork AI Studio/Plugins/configuration/plugin.lua`
Plugins can configure:
- Self-hosted LLM providers
- Update behavior
- Preview features visibility
- Preselected profiles
- Chat templates
- etc.
When adding configuration options, update:
-`app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs`: In method `TryProcessConfiguration` register new options.
-`app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs`: In method `LoadAll` check for leftover configuration.
- The corresponding data class in `app/MindWork AI Studio/Settings/DataModel/` to call `ManagedConfiguration.Register(...)`, when adding config options (in contrast to complex config. objects)
-`app/MindWork AI Studio/Tools/PluginSystem/PluginConfigurationObject.cs` for parsing logic of complex configuration objects.
-`app/MindWork AI Studio/Plugins/configuration/plugin.lua` to document the new configuration option.
## RAG (Retrieval-Augmented Generation)
RAG integration is currently in development (preview feature). Architecture:
- **External Retrieval Interface (ERI)** - Contract for integrating external data sources
- **Data Sources** - Local files and external data via ERI servers
- **Agents** - AI agents select data sources and validate retrieval quality
- **Embedding providers** - Support for various embedding models
- **Vector database** - Planned integration with Qdrant for vector storage
- **File processing** - Extracts text from PDF, DOCX, XLSX via Rust runtime
## Enterprise IT Support
AI Studio supports centralized configuration for enterprise environments:
- **Registry (Windows)** or **environment variables** (all platforms) specify configuration server URL and ID
- Configuration downloaded as ZIP containing Lua plugin
- Checks for updates every ~16 minutes via ETag
- Allows IT departments to pre-configure providers, settings, and chat templates
- **End of file formatting** - Do not append an extra empty line at the end of files. Preserve the existing file-ending style unless a specific formatter or file format requires a change.
- **Agent-run .NET builds** - Prefer `cd app/Build && dotnet run build`. When calling `dotnet` directly, use visible progress output and do not treat temporary silence as a failed build.
Changelogs are located in `app/MindWork AI Studio/wwwroot/changelog/` with filenames `vX.Y.Z.md`. These changelogs are meant to be for normal end-users
and should be written in a non-technical way, focusing on user-facing changes and improvements. Additionally, changes made regarding the plugin system
should be included in the changelog, especially if they affect how users can configure the app or if they introduce new capabilities for plugins. Plugin
developers should also be informed about these changes, as they might need to update their plugins accordingly. When adding entries to the changelog,
please ensure they are clear and concise, avoiding technical jargon where possible. Each entry starts with a dash and a space (`- `) and one of the