Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:AI QL Tuui Electron Renderer Process

From Leeroopedia
Knowledge Sources
Domains Electron, Vue, Frontend
Last Updated 2026-10-24 20:38 GMT

Overview

Chromium-based renderer process environment with Vue 3, Pinia state management, and Vuetify UI framework for building the tuui desktop chat interface.

Description

The Electron renderer process runs in a Chromium browser context with context isolation enabled (contextIsolation: true, nodeIntegration: false). It communicates with the main process exclusively through the preload bridge (window.mainApi, window.mcpServers, window.llmApis). The renderer uses Vue 3 with Composition API (script setup), Pinia for state management with persisted state plugin, Vuetify 4 for UI components, vue-i18n for localization, vue-router with hash history, and localforage for client-side persistent storage.

Usage

Use this environment for all code running in src/renderer/. Any implementation that uses Vue stores, composables, or the window.mainApi IPC bridge requires this environment.

System Requirements

Category Requirement Notes
OS macOS, Windows, or Linux Chromium renderer handles platform differences
Runtime Chromium (bundled with Electron 42+) No separate Node.js needed in renderer
Memory 256MB RAM minimum Vue reactivity + Vuetify component overhead

Dependencies

NPM Packages

  • `vue` >= 3.5.34
  • `vuetify` >= 4.0.7
  • `pinia` >= 3.0.4
  • `pinia-plugin-state-persistence` >= 1.11.0
  • `vue-router` >= 5.0.7
  • `vue-i18n` >= 11.4.2
  • `localforage` >= 1.10.0
  • `md-editor-v3` >= 6.5.0
  • `mermaid` >= 11.15.0
  • `highlight.js` >= 11.11.1
  • `katex` >= 0.16.46
  • `jwt-decode` >= 4.0.0
  • `vue3-lottie` >= 3.3.1
  • `@fontsource/inter` >= 5.2.8
  • `@mdi/font` >= 7.4.47

Build Tools

  • `vite` >= 7.3.1
  • `@vitejs/plugin-vue` >= 6.0.6
  • `vite-plugin-electron-renderer` >= 0.14.7
  • `vite-plugin-vuetify` >= 2.1.3

Credentials

No direct credentials required. API keys are managed through the LLM chatbot config (llm.json) and passed via the chatbotConfig store. JWT tokens are decoded client-side to check expiry.

Quick Install

npm install vue@^3.5.34 vuetify@^4.0.7 pinia@^3.0.4 pinia-plugin-state-persistence@^1.11.0 vue-router@^5.0.7 vue-i18n@^11.4.2 localforage@^1.10.0 jwt-decode@^4.0.0

Code Evidence

Context isolation settings from `src/main/utils/Constants.ts:46-53`:

static DEFAULT_WEB_PREFERENCES = {
  nodeIntegration: false,
  contextIsolation: true,
  enableRemoteModule: false,
  webSecurity: false,
  partition: Constants.PARTITION_NAME,
  preload: join(__dirname, '../preload/index.js')
}

Vue app bootstrap from `src/renderer/main.ts`:

import { createApp } from 'vue'
import { createPinia } from 'pinia'
// ... Vuetify, router, i18n setup

Common Errors

See Environment:AI_QL_Tuui_Electron_Preload_Process for IPC bridge details.
Error Message Cause Solution
`window.mainApi is undefined` Preload script not loaded Check preload path in webPreferences
`Pinia store not initialized` Store called outside setup() Ensure Pinia is installed before Vue app mount

Compatibility Notes

  • contextIsolation: Enabled — renderer cannot use Node.js APIs directly; all communication via preload bridge.
  • webSecurity: Disabled — allows cross-origin requests to LLM API endpoints.
  • Partition: Uses persist:{appName}-{env}-{schemaVersion} for session isolation.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment