-
Notifications
You must be signed in to change notification settings - Fork 0
02 Architecture and Core Engines
This document outlines the technical architecture, data flows, and low-level engineering systems powering WishPilot.
WishPilot is engineered on Electron 44, using a secure multi-process model separating node-level OS operations from the user interface:
┌────────────────────────────────────────────────────────────────────────┐
│ ELECTRON MAIN PROCESS │
│ (electron/main.cjs) │
│ │
│ - Window Management (Studio, HUD, Stealth Notch modes) │
│ - Global Keyboard Shortcut Listeners (Register / Unregister) │
│ - Windows Native Display Affinity (SetWindowDisplayAffinity) │
│ - Screen Capture Engine (desktopCapturer thumbnail stream) │
│ - Process List Scanner (tasklist platform inspection) │
└──────────────────┬──────────────────────────────────┬──────────────────┘
│ │
IPC Send / │ │ IPC Handlers &
Event Bridge │ │ Safe API Calls
▼ ▼
┌────────────────────────────────────────────────────────────────────────┐
│ ELECTRON PRELOAD BRIDGE │
│ (electron/preload.cjs) │
│ │
│ - contextBridge.exposeInMainWorld('wishpilot', { ... }) │
│ - Context Isolation: True | Node Integration: False │
└──────────────────┬──────────────────────────────────┬──────────────────┘
│ │
▼ ▼
┌────────────────────────────────────────────────────────────────────────┐
│ REACT 19 RENDERER PROCESS │
│ (src/App.jsx) │
│ │
│ ┌─────────────────────────┐ ┌─────────────────────────────────┐ │
│ │ Web Audio DSP Engine │ │ Unified AI Streaming Client │ │
│ │ (audioTranscriber.js) │ │ (aiService.js) │ │
│ └───────────┬─────────────┘ └────────────────┬────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────┐ ┌─────────────────────────────────┐ │
│ │ Groq Whisper STT API │ │ 9 AI Inference Endpoints │ │
│ │ (Direct HTTPS) │ │ (Direct HTTPS / BYOK) │ │
│ └─────────────────────────┘ └─────────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────────┘
WishPilot operates as a single dynamic window that transitions seamlessly between three operational modes without destroying state:
- The main configuration, testing, and debriefing cockpit.
- Provides access to all 6 tabs: Sessions & Roles, Models & Audio, Live Test Lab, Mock Simulator, Debrief & Export, Resume & JD, and Display & Environment.
- Non-draggable content area with intuitive navigation.
- Minimalist, always-on-top translucent heads-up display.
- Drag handle across the header bar (
-webkit-app-region: drag). - Renders streaming answers, 10-second TL;DR punchlines, and instant refinement pills.
- Adjustable opacity slider (from 12% to 100%) and optional click-through mode (
SetIgnoreMouseEvents).
- Compact pill docked at the top center of the screen.
- Displays a real-time mini voice waveform bar, microphone status, and a single-click button to trigger an answer or expand back to full mode.
The speech intelligence engine in src/services/audioTranscriber.js converts raw microphone signals into structured text with ultra-low latency:
[Microphone Hardware]
│ 48kHz / 44.1kHz Stereo Float32 Stream
▼
[Web Audio API Context]
│ AudioNode Graph
▼
[AudioWorklet / ScriptProcessorNode]
│ Real-time chunk capture (4096 samples)
▼
[Voice Activity Detection (VAD) & Energy Gate]
│ Energy Threshold > 0.008 RMS
▼
[Linear Interpolation Resampler]
│ Downsample to 16,000 Hz Mono Float32
▼
[Binary RIFF WAV Encoder]
│ Construct 44-byte standard RIFF header + 16-bit PCM buffer
▼
[Multipart Form-Data Dispatch]
│ Direct HTTPS POST to Groq Whisper Endpoint
▼
[Groq Whisper Large v3 Turbo]
│ ~200ms Processing Latency
▼
[Real-Time Spoken Transcript]
Microphones typically record at 44,100 Hz or 48,000 Hz. WishPilot downsamples in-memory to 16,000 Hz (the optimal sample rate for Whisper) using weighted accumulator averages, avoiding high CPU overhead:
function downsampleTo16k(inputSamples, inputSampleRate, outputSampleRate = 16000) {
if (inputSampleRate === outputSampleRate) return inputSamples;
const ratio = inputSampleRate / outputSampleRate;
const newLength = Math.round(inputSamples.length / ratio);
const result = new Float32Array(newLength);
let offsetResult = 0;
let offsetBuffer = 0;
while (offsetResult < result.length) {
const nextOffsetBuffer = Math.round((offsetResult + 1) * ratio);
let accum = 0;
let count = 0;
for (let i = offsetBuffer; i < nextOffsetBuffer && i < inputSamples.length; i++) {
accum += inputSamples[i];
count++;
}
result[offsetResult] = count > 0 ? accum / count : (inputSamples[offsetBuffer] || 0);
offsetResult++;
offsetBuffer = nextOffsetBuffer;
}
return result;
}When presenting your screen during a technical interview or team review, WishPilot utilizes native Windows API display protection:
SetWindowDisplayAffinity(hwnd, WDA_EXCLUDEFROMCAPTURE);In Electron, this is implemented via:
mainWindow.setContentProtection(true);- The window continues to render normally to your primary physical monitor.
- When any process attempts to invoke the Windows Graphics Capture API (DirectX, BitBlt, Windows Media Capture, Zoom/Teams screen sharing, or Discord streaming), the DWM treats the WishPilot window bounds as transparent.
- As a result, your practice notes, HUD overlay, and transcripts remain exclusively visible to your physical eyes without ever bleeding onto the shared presentation stream.
WishPilot enforces strict local-first security:
- Zero External Middlemen: There is no proxy server, authentication backend, or logging cluster between WishPilot and the LLM APIs.
-
Key Storage: API keys are stored in
window.localStorageunder the keywishpilot_api_keys. They never leave your local machine except asAuthorization: Bearer <KEY>headers sent directly toapi.groq.com,api.openai.com, etc. -
Screen Capture Memory Buffer: When
Ctrl + Shift + Sis triggered, the screenshot thumbnail is processed entirely in memory as a base64 Data URL, passed to the vision LLM prompt, and immediately garbage-collected upon answer completion.
WishPilot v1.0.0 • Developed by Vishwjeet Singh Vilkhu • Licensed under GNU GPL v3.0
Wiki Home •
Repository •
Releases •
Report Issue
- 3. Supported AI Providers & Setup
- 4. Multi-Industry Category Engine
- 5. Instant Answer Refinement Pills
WishPilot v1.0.0
Built by Vishwjeet Singh Vilkhu
Licensed under GNU GPL v3.0