# hawkxtreme/mini-ai-1c architecture

> Architecture diagram of the GitHub repository hawkxtreme/mini-ai-1c, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hawkxtreme/mini-ai-1c
- Repository: https://github.com/hawkxtreme/mini-ai-1c

## Overview

1. **Overall shape**
   - This repo is a **desktop product with three main parts**:
     - a **Tauri 2 + React** user application,
     - a **Rust MCP/search service** for 1C configuration source code,
     - a **1C platform extension** (`1c_mcp_ext`) that exposes metadata and helper services from inside 1C itself.
   - The app is not a typical web backend/frontend split; the desktop shell is the control plane, while integrations happen through local process bridges, MCP, and 1C HTTP services.

2. **Main desktop shell**
   - The primary runtime is in `tauri-app/`.
   - `src/` is the **React 19 + TypeScript UI**: chat, settings, onboarding, code panels, overlay window, voice input, and Monaco-based BSL editor components.
   - `src-tauri/` is the **Rust backend** that owns native capabilities: filesystem/process integration, settings persistence, bridge orchestration, MCP connectivity, AI provider adapters, and Windows-specific behavior.

3. **UI-to-backend boundary**
   - The React app is organized around contexts and feature slices:
     - `ChatContext`, `BslContext`, `ProfileContext`, `SettingsContext`, `ConfiguratorContext`
     - UI features for chat sessions, code side panel, prompts, slash commands, MCP settings, and BSL diagnostics.
   - Frontend logic delegates hard work to Tauri commands in `src-tauri/src/commands/`, so the architecture is **thin UI / native orchestration backend** rather than a browser app with direct external calls.

4. **Chat and LLM orchestration**
   - The backend contains the LLM abstraction layer in `src-tauri/src/llm/`, with provider support for OpenAI-compatible APIs and CLI-based providers such as Codex and Qwen.
   - Higher-level AI flows live in `src-tauri/src/ai/`: prompt assembly, tool routing, model-specific client adapters, and tool definitions.
   - The UI’s chat components feed context, slash commands, diagnostics, and code snippets into this layer; the response path supports streaming, tool calls, diff/apply workflows, and session persistence.

5. **Code-centric workflow**
   - The product is built around **one active 1C module at a time**.
   - Code context is captured, normalized, and passed through:
     - BSL syntax guard / diagnostics,
     - prompt builders,
     - diff generation and interactive apply/revert flows,
     - session history management.
   - This is reflected in frontend code for `CodeSidePanel`, `DiffViewer`, `BslEditor`, and backend modules for `bsl_client`, `semantic_bridge`, `history_manager`, and `editor_bridge`.

6. **1C Configurator integration**
   - Native integration with the 1C Configurator is a major subsystem.
   - The backend owns the orchestration, while a separate native helper (`EditorBridge.exe`, represented in `src-tauri/src/editor_bridge*`) handles **reading/writing module text through UIAutomation and Windows message input**.
   - Communication between the main app and this helper is via a **Named Pipe**. This is the critical boundary for getting code in and out of the 1C IDE without clipboard dependence.

7. **BSL Language Server subsystem**
   - The app ships with a bundled **BSL Language Server JAR** under `src-tauri/bin/`.
   - Backend modules such as `bsl_client`, `bsl_installer`, `scintilla`, and settings-related commands manage installation checks, startup, connectivity, and diagnostics.
   - The frontend editor uses this for syntax highlighting and linting; the backend uses diagnostics to power “fix errors” flows and to provide structured feedback to LLM prompts.

8. **MCP tool layer**
   - MCP is a first-class integration boundary in this repo.
   - The desktop app can connect to external MCP servers from settings, but it also ships with built-in 1C-oriented servers:
     - help/reference,
     - Naparnik,
     - metadata,
     - configuration search.
   - The backend MCP client and tool registry sit between AI providers and tool execution, so models can request local or remote data without the UI directly knowing implementation details.

9. **Search/indexing service for large 1C codebases**
   - `tauri-app/mcp-1c-search/` is a separate Rust crate and binary dedicated to **searching and analyzing exported 1C configuration source trees**.
   - It includes parsing, semantic indexing, workspace management, and tool wiring.
   - This is not just a utility; architecturally it is the **high-performance source intelligence service** that powers fast symbol search, cross-reference style queries, and large-config navigation.

10. **1C extension for metadata exposure**
   - The top-level `1c_mcp_ext/` folder is a packaged **1C extension/configuration artifact**.
   - It defines common modules, data processors, HTTP service endpoints, roles, languages, and subsystems for exposing metadata and related operations to the desktop app.
   - This is a separate deployment unit from the Tauri app: it runs inside the 1C ecosystem and is reached over HTTP, not via local process calls.

11. **Windows-only native integration points**
   - The README and file tree show this product is strongly Windows-oriented for the 1C IDE workflow.
   - The backend includes mouse hooks, overlay window management, Win32-style interaction, and a special overlay mode.
   - These pieces support the “quick actions” popup inside the Configurator and the remote-desktop-friendly input path.

12. **Persistence and configuration**
   - Settings, profiles, prompt rules, slash commands, and MCP server definitions are managed as app state and persisted by the Rust backend.
   - The React UI exposes these via dedicated settings tabs, but the canonical state lives in backend-managed data models.
   - Export/import is a structural config boundary: credentials are handled separately from portable settings.

13. **Data flow summary**
   - Typical flow: **user action in React UI → Tauri command → Rust orchestration → editor/BSL/MCP/LLM integration → streamed result back to UI → optional apply to 1C Configurator**.
   - Secondary flow: **model tool call → MCP client or local helper → result injected into the ongoing AI conversation**.
   - This architecture is centered on **capturing code context, enriching it with diagnostics and external knowledge, and writing results back to the 1C editor**.

14. **What to draw in an architecture diagram**
   - The key boxes are:
     - React/Tauri desktop app,
     - Rust AI orchestration layer,
     - EditorBridge native helper,
     - BSL Language Server,
     - MCP servers (external and bundled),
     - 1C Configurator,
     - 1C extension HTTP service,
     - optional cloud/local LLM providers.
   - The most important boundaries are between **UI vs native backend**, **desktop app vs 1C IDE**, and **local orchestration vs external knowledge/tool services**.

Main entry points: [`tauri-app/src`](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src) (React UI), [`tauri-app/src-tauri/src/ai`](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src-tauri/src/ai) (AI orchestration), [`tauri-app/src-tauri/src/commands`](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src-tauri/src/commands) (Tauri commands), [`tauri-app/mcp-1c-search/src`](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/mcp-1c-search/src) (Search engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_desktop["Desktop app"]
  node_node_ui["React UI<br/>Tauri frontend"]
  node_node_ui_contexts["App state<br/>UI contexts"]
  node_node_ui_chat["Chat views<br/>UI feature"]
  node_node_ui_code["Code panel<br/>UI feature"]
  node_node_ui_settings["Settings tabs<br/>UI feature"]
  node_node_ui_voice(("Voice input<br/>UI feature"))
end

subgraph group_group_native["Native backend"]
  node_node_cmds["Tauri commands<br/>Rust command API"]
  node_node_settings["Settings core<br/>Rust state<br/>[settings.rs]"]
  node_node_chat_ai["AI orchestration<br/>Rust AI layer"]
  node_node_llm["LLM providers<br/>Rust provider layer"]
  node_node_mcp_client["MCP client<br/>Rust tool bridge<br/>[mcp_client.rs]"]
  node_node_bsl["BSL language<br/>Rust BSL integration<br/>[bsl_client.rs]"]
  node_node_configurator["Configurator bridge<br/>Rust integration<br/>[configurator.rs]"]
  node_node_editor_bridge["EditorBridge<br/>Native helper<br/>[editor_bridge.rs]"]
  node_node_semantic_bridge["Semantic bridge<br/>Rust bridge<br/>[semantic_bridge.rs]"]
  node_node_history["Session history<br/>Rust persistence<br/>[history_manager.rs]"]
  node_node_overlay(("Overlay mode<br/>UI/runtime"))
end

subgraph group_group_search["Search service"]
  node_node_search_service["Search engine<br/>Rust service"]
  node_node_search_parser["BSL parser<br/>Search subsystem"]
  node_node_search_semantic["Semantic index<br/>Search subsystem<br/>[semantic.rs]"]
  node_node_search_tools["Search tools<br/>MCP tools<br/>[tools.rs]"]
end

subgraph group_group_1c_ext["1C extension"]
  node_node_ext_http["HTTP API<br/>1C HTTP service"]
  node_node_ext_modules["Common modules<br/>1C modules"]
  node_node_ext_data["Data processors"]
  node_node_ext_subsystems["1C subsystems<br/>1C package"]
end

node_node_ui -->|"stores state in"| node_node_ui_contexts
node_node_ui -->|"renders"| node_node_ui_chat
node_node_ui -->|"renders"| node_node_ui_code
node_node_ui -->|"renders"| node_node_ui_settings
node_node_ui -->|"captures input"| node_node_ui_voice
node_node_ui -->|"calls"| node_node_cmds
node_node_cmds -->|"reads/writes"| node_node_settings
node_node_cmds -->|"orchestrates"| node_node_chat_ai
node_node_chat_ai -->|"uses"| node_node_llm
node_node_chat_ai -->|"invokes tools"| node_node_mcp_client
node_node_chat_ai -->|"consumes diagnostics"| node_node_bsl
node_node_chat_ai -->|"persists sessions"| node_node_history
node_node_cmds -->|"controls"| node_node_configurator
node_node_configurator -->|"bridges via pipe"| node_node_editor_bridge
node_node_configurator -->|"normalizes context"| node_node_semantic_bridge
node_node_overlay -->|"supports quick actions"| node_node_configurator
node_node_search_service -->|"parses"| node_node_search_parser
node_node_search_service -->|"indexes"| node_node_search_semantic
node_node_search_service -->|"exposes tools"| node_node_search_tools
node_node_mcp_client -->|"queries"| node_node_search_service
node_node_mcp_client -->|"calls"| node_node_ext_http
node_node_ext_http -->|"implemented by"| node_node_ext_modules
node_node_ext_http -->|"drives"| node_node_ext_data
node_node_ext_subsystems -.->|"organizes"| node_node_ext_http
node_node_ui_code -->|"shows diagnostics"| node_node_bsl
node_node_ui_chat -->|"streams to"| node_node_chat_ai
node_node_ui_settings -->|"edits"| node_node_settings

click node_node_ui "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src"
click node_node_ui_contexts "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/contexts"
click node_node_ui_chat "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/components/chat"
click node_node_ui_code "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/components/CodeSidePanel"
click node_node_ui_settings "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/components/settings"
click node_node_ui_voice "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/voice"
click node_node_cmds "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src-tauri/src/commands"
click node_node_settings "https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/settings.rs"
click node_node_chat_ai "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src-tauri/src/ai"
click node_node_llm "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src-tauri/src/llm"
click node_node_mcp_client "https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/mcp_client.rs"
click node_node_bsl "https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/bsl_client.rs"
click node_node_configurator "https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/configurator.rs"
click node_node_editor_bridge "https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/editor_bridge.rs"
click node_node_semantic_bridge "https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/semantic_bridge.rs"
click node_node_history "https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/history_manager.rs"
click node_node_overlay "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/windows"
click node_node_search_service "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/mcp-1c-search/src"
click node_node_search_parser "https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/mcp-1c-search/src/parser"
click node_node_search_semantic "https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/mcp-1c-search/src/semantic.rs"
click node_node_search_tools "https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/mcp-1c-search/src/tools.rs"
click node_node_ext_http "https://github.com/hawkxtreme/mini-ai-1c/tree/main/1c_mcp_ext/HTTPServices/mcp_APIBackend"
click node_node_ext_modules "https://github.com/hawkxtreme/mini-ai-1c/tree/main/1c_mcp_ext/CommonModules"
click node_node_ext_data "https://github.com/hawkxtreme/mini-ai-1c/tree/main/1c_mcp_ext/DataProcessors"
click node_node_ext_subsystems "https://github.com/hawkxtreme/mini-ai-1c/tree/main/1c_mcp_ext/Subsystems"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_ui,node_node_ui_contexts,node_node_ui_chat,node_node_ui_code,node_node_ui_settings,node_node_ui_voice toneBlue
class node_node_cmds,node_node_settings,node_node_chat_ai,node_node_llm,node_node_mcp_client,node_node_bsl,node_node_configurator,node_node_editor_bridge,node_node_semantic_bridge,node_node_history,node_node_overlay toneAmber
class node_node_search_service,node_node_search_parser,node_node_search_semantic,node_node_search_tools toneMint
class node_node_ext_http,node_node_ext_modules,node_node_ext_data,node_node_ext_subsystems toneRose
```

## Components

### Desktop app

Tauri shell and React UI

- [React UI](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src): Tauri frontend · Chat-centric desktop interface with panels, settings, editor and overlay windows · `tauri-app/src`
- [App state](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/contexts): UI contexts · Shared client state for chat, BSL, profiles, settings and configurator · `tauri-app/src/contexts`
- [Chat views](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/components/chat): UI feature · Session list, message stream, tool calls, diffs and command menu · `tauri-app/src/components/chat`
- [Code panel](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/components/CodeSidePanel): UI feature · BSL editor, diagnostics, MCP tools and diff-focused code workflow · `tauri-app/src/components/CodeSidePanel`
- [Settings tabs](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/components/settings): UI feature · Configuration screens for LLMs, MCP, prompts, commands, BSL and configurator · `tauri-app/src/components/settings`
- [Voice input](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/voice): UI feature · Mic activity and speech recognition for conversational input · `tauri-app/src/voice`

### Native backend

Rust orchestration, commands, editor and AI integration

- [Tauri commands](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src-tauri/src/commands): Rust command API · Boundary surface used by the UI to invoke native operations · `tauri-app/src-tauri/src/commands`
- [Settings core](https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/settings.rs): Rust state · Persisted app settings, profiles and secrets handling · `tauri-app/src-tauri/src/settings.rs`
- [AI orchestration](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src-tauri/src/ai): Rust AI layer · Prompt assembly, tool routing and conversation flow management · `tauri-app/src-tauri/src/ai`
- [LLM providers](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src-tauri/src/llm): Rust provider layer · OpenAI-compatible and CLI-based model adapters · `tauri-app/src-tauri/src/llm`
- [MCP client](https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/mcp_client.rs): Rust tool bridge · Connects desktop app to external and bundled MCP servers · `tauri-app/src-tauri/src/mcp_client.rs`
- [BSL language](https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/bsl_client.rs): Rust BSL integration · Language server install, connectivity and diagnostics plumbing · `tauri-app/src-tauri/src/bsl_client.rs`
- [Configurator bridge](https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/configurator.rs): Rust integration · Orchestrates the 1C IDE workflow and module synchronization · `tauri-app/src-tauri/src/configurator.rs`
- [EditorBridge](https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/editor_bridge.rs): Native helper · Windows helper for reading and writing 1C module text through UI automation · `tauri-app/src-tauri/src/editor_bridge.rs`
- [Semantic bridge](https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/semantic_bridge.rs): Rust bridge · Translates editor and code context into backend-friendly semantic data · `tauri-app/src-tauri/src/semantic_bridge.rs`
- [Session history](https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/src-tauri/src/history_manager.rs): Rust persistence · Tracks conversation and code session state across edits · `tauri-app/src-tauri/src/history_manager.rs`
- [Overlay mode](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/src/windows): UI/runtime · Quick actions and overlay window used alongside the 1C IDE · `tauri-app/src/windows`

### Search service

Standalone Rust workspace for 1C source intelligence

- [Search engine](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/mcp-1c-search/src): Rust service · Standalone search and analysis service for exported 1C source trees · `tauri-app/mcp-1c-search/src`
- [BSL parser](https://github.com/hawkxtreme/mini-ai-1c/tree/main/tauri-app/mcp-1c-search/src/parser): Search subsystem · Parses 1C module text into AST and syntax structures · `tauri-app/mcp-1c-search/src/parser`
- [Semantic index](https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/mcp-1c-search/src/semantic.rs): Search subsystem · Builds searchable symbols, relationships and workspace context · `tauri-app/mcp-1c-search/src/semantic.rs`
- [Search tools](https://github.com/hawkxtreme/mini-ai-1c/blob/main/tauri-app/mcp-1c-search/src/tools.rs): MCP tools · Tool wiring for search, metadata and workspace queries · `tauri-app/mcp-1c-search/src/tools.rs`

### 1C extension

Packaged 1C-side HTTP and metadata extension

- [HTTP API](https://github.com/hawkxtreme/mini-ai-1c/tree/main/1c_mcp_ext/HTTPServices/mcp_APIBackend): 1C HTTP service · Entry point exposed from inside 1C for app-facing operations · `1c_mcp_ext/HTTPServices/mcp_APIBackend`
- [Common modules](https://github.com/hawkxtreme/mini-ai-1c/tree/main/1c_mcp_ext/CommonModules): 1C modules · Shared BSL modules for execution, metadata, content and utilities · `1c_mcp_ext/CommonModules`
- [Data processors](https://github.com/hawkxtreme/mini-ai-1c/tree/main/1c_mcp_ext/DataProcessors): 1C data processors · 1C-side processors for configuration data, syntax resources and server control · `1c_mcp_ext/DataProcessors`
- [1C subsystems](https://github.com/hawkxtreme/mini-ai-1c/tree/main/1c_mcp_ext/Subsystems): 1C package · Subsystem definitions that organize the MCP server capability set · `1c_mcp_ext/Subsystems`

## Connections

- React UI → App state: stores state in · React features share chat, BSL, profile, settings and configurator state through contexts
- React UI → Chat views: renders · Main conversation experience is built from chat-oriented components
- React UI → Code panel: renders · Code panel supports active module inspection, diagnostics and diffs
- React UI → Settings tabs: renders · Settings UI exposes LLM, MCP, prompt and configurator controls
- React UI → Voice input: captures input · Voice input can feed chat composition
- React UI → Tauri commands: calls · Frontend delegates native work to Tauri commands
- Tauri commands → Settings core: reads/writes · Commands persist app configuration and profile data
- Tauri commands → AI orchestration: orchestrates · Command handlers drive chat, prompt and tool execution flows
- AI orchestration → LLM providers: uses · AI layer selects and invokes model providers
- AI orchestration → MCP client: invokes tools · Model tool calls are routed through MCP client execution
- AI orchestration → BSL language: consumes diagnostics · Prompting and fix flows incorporate BSL language server feedback
- AI orchestration → Session history: persists sessions · Chat and code sessions are recorded for later continuation
- Tauri commands → Configurator bridge: controls · Configurator commands manage the 1C IDE workflow
- Configurator bridge → EditorBridge: bridges via pipe · Main app communicates with the external editor helper over a named pipe
- Configurator bridge → Semantic bridge: normalizes context · Code and editor state are converted into semantic context for prompts and edits
- Overlay mode → Configurator bridge: supports quick actions · Overlay mode provides in-IDE actions and interaction shortcuts
- Search engine → BSL parser: parses · Search service turns exported BSL source into syntax structures
- Search engine → Semantic index: indexes · Semantic subsystem builds code intelligence over a workspace
- Search engine → Search tools: exposes tools · Search capabilities are packaged as MCP-style tools
- MCP client → Search engine: queries · Desktop app can connect to the dedicated search/indexing service
- MCP client → HTTP API: calls · MCP and helper flows can reach the 1C-side HTTP API
- HTTP API → Common modules: implemented by · HTTP endpoints delegate to shared BSL modules
- HTTP API → Data processors: drives · Data processors provide server control and metadata-oriented operations
- 1C subsystems → HTTP API: organizes · Subsystems group the exposed 1C MCP server functionality
- Code panel → BSL language: shows diagnostics · Editor view reflects syntax and lint results from the language server
- Chat views → AI orchestration: streams to · Messages, context and tool results flow into the AI layer
- Settings tabs → Settings core: edits · Settings screens are the UI for backend-owned state
