How hawkxtreme/mini-ai-1c works
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 React UI · ai AI orchestration · commands Tauri commands · mcp-1c-search/src Search engine
Components 25
Desktop app
Tauri shell and React UI
- React UI · Chat-centric desktop interface with panels, settings, editor and overlay windows
tauri-app/src - App state · Shared client state for chat, BSL, profiles, settings and configurator
tauri-app/src/contexts - Chat views · Session list, message stream, tool calls, diffs and command menu
tauri-app/src/components/chat - Code panel · BSL editor, diagnostics, MCP tools and diff-focused code workflow
tauri-app/src/components/CodeSidePanel - Settings tabs · Configuration screens for LLMs, MCP, prompts, commands, BSL and configurator
tauri-app/src/components/settings - Voice input · Mic activity and speech recognition for conversational input
tauri-app/src/voice
Native backend
Rust orchestration, commands, editor and AI integration
- Tauri commands · Boundary surface used by the UI to invoke native operations
tauri-app/src-tauri/src/commands - Settings core · Persisted app settings, profiles and secrets handling
tauri-app/src-tauri/src/settings.rs - AI orchestration · Prompt assembly, tool routing and conversation flow management
tauri-app/src-tauri/src/ai - LLM providers · OpenAI-compatible and CLI-based model adapters
tauri-app/src-tauri/src/llm - MCP client · Connects desktop app to external and bundled MCP servers
tauri-app/src-tauri/src/mcp_client.rs - BSL language · Language server install, connectivity and diagnostics plumbing
tauri-app/src-tauri/src/bsl_client.rs - Configurator bridge · Orchestrates the 1C IDE workflow and module synchronization
tauri-app/src-tauri/src/configurator.rs - EditorBridge · Windows helper for reading and writing 1C module text through UI automation
tauri-app/src-tauri/src/editor_bridge.rs - Semantic bridge · Translates editor and code context into backend-friendly semantic data
tauri-app/src-tauri/src/semantic_bridge.rs - Session history · Tracks conversation and code session state across edits
tauri-app/src-tauri/src/history_manager.rs - Overlay mode · 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 · Standalone search and analysis service for exported 1C source trees
tauri-app/mcp-1c-search/src - BSL parser · Parses 1C module text into AST and syntax structures
tauri-app/mcp-1c-search/src/parser - Semantic index · Builds searchable symbols, relationships and workspace context
tauri-app/mcp-1c-search/src/semantic.rs - Search 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 · Entry point exposed from inside 1C for app-facing operations
1c_mcp_ext/HTTPServices/mcp_APIBackend - Common modules · Shared BSL modules for execution, metadata, content and utilities
1c_mcp_ext/CommonModules - Data processors · 1C-side processors for configuration data, syntax resources and server control
1c_mcp_ext/DataProcessors - 1C subsystems · Subsystem definitions that organize the MCP server capability set
1c_mcp_ext/Subsystems
Connections 27
- 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