# gguatit/cue architecture

> Architecture diagram of the GitHub repository gguatit/cue, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gguatit/cue
- Repository: https://github.com/gguatit/cue

## Overview

Cue is a Windows desktop assistant whose main workflow is a pointer-triggered screen capture, vision-AI request, and discreet answer presentation. The graph preserves its distinct capture, answer, and output stages plus configuration, protection, update, and experimental capabilities. Edges reflect the shown IPC calls, imports, or README descriptions; some Rust internals and UI branches were not excerpted, so uncertain implementation links are omitted or marked unverified.

Main entry points: [`src-tauri/src/commands.rs`](https://github.com/gguatit/cue/blob/main/src-tauri/src/commands.rs) (Tauri command bridge), [`src/stores/answer.ts`](https://github.com/gguatit/cue/blob/main/src/stores/answer.ts) (Answer orchestration), [`src/views/settings/AiTab.tsx`](https://github.com/gguatit/cue/blob/main/src/views/settings/AiTab.tsx) (AI settings), [`src-tauri/src/shortcut.rs`](https://github.com/gguatit/cue/blob/main/src-tauri/src/shortcut.rs) (Shortcut and gestures)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Capture and answer"]
  node_trigger["Shortcut and gestures<br/>[shortcut.rs]"]
  node_ipc["Tauri command bridge<br/>[commands.rs]"]
  node_capture["Screen capture<br/>[capture.rs]"]
  node_ai["Vision AI harness<br/>[ai.rs]"]
  node_providers{{"AI providers"}}
  node_answer_state["Answer orchestration<br/>[answer.ts]"]
end

subgraph group_presentation["Answer presentation"]
  node_overlay["Answer overlay<br/>[OverlayView.tsx]"]
  node_tray["Tray answer display<br/>[tray.rs]"]
  node_led["Keyboard LED output<br/>[led.rs]"]
  node_brightness["Brightness output<br/>[brightness.rs]"]
  node_meeting["Meeting detection<br/>[meeting.rs]"]
end

subgraph group_configuration["Setup and settings"]
  node_settings["Settings state<br/>[settings.ts]"]
  node_onboarding["Onboarding<br/>[Onboarding.tsx]"]
  node_ai_settings["AI settings<br/>[AiTab.tsx]"]
  node_security_settings["Security settings<br/>[SecurityTab.tsx]"]
end

subgraph group_platform["Protection and platform"]
  node_protection["Capture protection<br/>[windows.rs]"]
  node_guard["Survival protection<br/>[guard.rs]"]
  node_updates["Signed updates<br/>[updates.rs]"]
end

subgraph group_extensions["Optional capabilities"]
  node_cue_air["Cue Air<br/>[air.rs]"]
  node_lab["Cue Test Lab<br/>[App.tsx]"]
  node_prompts["Prompt library<br/>[PromptLibrary.tsx]"]
end

node_user(("User"))

node_user -->|"triggers capture"| node_trigger
node_trigger -.->|"dispatches commands"| node_ipc
node_ipc -->|"captures display"| node_capture
node_ipc -->|"requests answer"| node_ai
node_ai -.->|"sends AI request"| node_providers
node_answer_state -->|"invokes capture"| node_ipc
node_answer_state -->|"shows answer"| node_overlay
node_answer_state -->|"sets tray answer"| node_tray
node_answer_state -.->|"blinks answer"| node_led
node_answer_state -.->|"blinks answer"| node_brightness
node_answer_state -->|"checks meeting state"| node_meeting
node_ipc -->|"protects overlay"| node_protection
node_onboarding -->|"configures setup"| node_settings
node_ai_settings -.->|"updates provider"| node_settings
node_ai_settings -->|"tests connection"| node_ipc
node_security_settings -.->|"requests security actions"| node_ipc
node_ipc -->|"manages protection"| node_guard
node_ipc -->|"runs update actions"| node_updates
node_answer_state -->|"publishes answer"| node_cue_air
node_lab -.->|"offers prompt library"| node_prompts

click node_trigger "https://github.com/gguatit/cue/blob/main/src-tauri/src/shortcut.rs"
click node_ipc "https://github.com/gguatit/cue/blob/main/src-tauri/src/commands.rs"
click node_capture "https://github.com/gguatit/cue/blob/main/src-tauri/src/capture.rs"
click node_ai "https://github.com/gguatit/cue/blob/main/src-tauri/src/ai.rs"
click node_answer_state "https://github.com/gguatit/cue/blob/main/src/stores/answer.ts"
click node_overlay "https://github.com/gguatit/cue/blob/main/src/overlay/OverlayView.tsx"
click node_tray "https://github.com/gguatit/cue/blob/main/src-tauri/src/tray.rs"
click node_led "https://github.com/gguatit/cue/blob/main/src-tauri/src/led.rs"
click node_brightness "https://github.com/gguatit/cue/blob/main/src-tauri/src/brightness.rs"
click node_meeting "https://github.com/gguatit/cue/blob/main/src-tauri/src/meeting.rs"
click node_settings "https://github.com/gguatit/cue/blob/main/src/stores/settings.ts"
click node_onboarding "https://github.com/gguatit/cue/blob/main/src/views/onboarding/Onboarding.tsx"
click node_ai_settings "https://github.com/gguatit/cue/blob/main/src/views/settings/AiTab.tsx"
click node_security_settings "https://github.com/gguatit/cue/blob/main/src/views/settings/SecurityTab.tsx"
click node_protection "https://github.com/gguatit/cue/blob/main/src-tauri/src/windows.rs"
click node_guard "https://github.com/gguatit/cue/blob/main/src-tauri/src/guard.rs"
click node_updates "https://github.com/gguatit/cue/blob/main/src-tauri/src/updates.rs"
click node_cue_air "https://github.com/gguatit/cue/blob/main/src-tauri/src/air.rs"
click node_lab "https://github.com/gguatit/cue/blob/main/site/src/App.tsx"
click node_prompts "https://github.com/gguatit/cue/blob/main/site/src/components/PromptLibrary.tsx"

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_trigger,node_ipc,node_capture,node_ai,node_providers,node_answer_state,node_user toneBlue
class node_overlay,node_tray,node_led,node_brightness,node_meeting toneAmber
class node_settings,node_onboarding,node_ai_settings,node_security_settings toneMint
class node_protection,node_guard,node_updates toneRose
class node_cue_air,node_lab,node_prompts toneIndigo
```

## Components

### Capture and answer

- [Shortcut and gestures](https://github.com/gguatit/cue/blob/main/src-tauri/src/shortcut.rs): `src-tauri/src/shortcut.rs`
- [Tauri command bridge](https://github.com/gguatit/cue/blob/main/src-tauri/src/commands.rs): `src-tauri/src/commands.rs`
- [Screen capture](https://github.com/gguatit/cue/blob/main/src-tauri/src/capture.rs): `src-tauri/src/capture.rs`
- [Vision AI harness](https://github.com/gguatit/cue/blob/main/src-tauri/src/ai.rs): `src-tauri/src/ai.rs`
- **AI providers**
- [Answer orchestration](https://github.com/gguatit/cue/blob/main/src/stores/answer.ts): `src/stores/answer.ts`

### Answer presentation

- [Answer overlay](https://github.com/gguatit/cue/blob/main/src/overlay/OverlayView.tsx): `src/overlay/OverlayView.tsx`
- [Tray answer display](https://github.com/gguatit/cue/blob/main/src-tauri/src/tray.rs): `src-tauri/src/tray.rs`
- [Keyboard LED output](https://github.com/gguatit/cue/blob/main/src-tauri/src/led.rs): `src-tauri/src/led.rs`
- [Brightness output](https://github.com/gguatit/cue/blob/main/src-tauri/src/brightness.rs): `src-tauri/src/brightness.rs`
- [Meeting detection](https://github.com/gguatit/cue/blob/main/src-tauri/src/meeting.rs): `src-tauri/src/meeting.rs`

### Setup and settings

- [Settings state](https://github.com/gguatit/cue/blob/main/src/stores/settings.ts): `src/stores/settings.ts`
- [Onboarding](https://github.com/gguatit/cue/blob/main/src/views/onboarding/Onboarding.tsx): `src/views/onboarding/Onboarding.tsx`
- [AI settings](https://github.com/gguatit/cue/blob/main/src/views/settings/AiTab.tsx): `src/views/settings/AiTab.tsx`
- [Security settings](https://github.com/gguatit/cue/blob/main/src/views/settings/SecurityTab.tsx): `src/views/settings/SecurityTab.tsx`

### Protection and platform

- [Capture protection](https://github.com/gguatit/cue/blob/main/src-tauri/src/windows.rs): `src-tauri/src/windows.rs`
- [Survival protection](https://github.com/gguatit/cue/blob/main/src-tauri/src/guard.rs): `src-tauri/src/guard.rs`
- [Signed updates](https://github.com/gguatit/cue/blob/main/src-tauri/src/updates.rs): `src-tauri/src/updates.rs`

### Optional capabilities

- [Cue Air](https://github.com/gguatit/cue/blob/main/src-tauri/src/air.rs): `src-tauri/src/air.rs`
- [Cue Test Lab](https://github.com/gguatit/cue/blob/main/site/src/App.tsx): `site/src/App.tsx`
- [Prompt library](https://github.com/gguatit/cue/blob/main/site/src/components/PromptLibrary.tsx): `site/src/components/PromptLibrary.tsx`

### Other components

- **User**

## Connections

- User → Shortcut and gestures: triggers capture (evidence: `README.md`)
- Shortcut and gestures → Tauri command bridge: dispatches commands (evidence: `src-tauri/src/shortcut.rs`)
- Tauri command bridge → Screen capture: captures display (evidence: `src-tauri/src/commands.rs`)
- Tauri command bridge → Vision AI harness: requests answer (evidence: `src-tauri/src/commands.rs`)
- Vision AI harness → AI providers: sends AI request (evidence: `README.md`)
- Answer orchestration → Tauri command bridge: invokes capture (evidence: `src/stores/answer.ts`)
- Answer orchestration → Answer overlay: shows answer (evidence: `src/stores/answer.ts`)
- Answer orchestration → Tray answer display: sets tray answer (evidence: `src/stores/answer.ts`)
- Answer orchestration → Keyboard LED output: blinks answer
- Answer orchestration → Brightness output: blinks answer
- Answer orchestration → Meeting detection: checks meeting state (evidence: `src/stores/answer.ts`)
- Tauri command bridge → Capture protection: protects overlay (evidence: `src-tauri/src/commands.rs`)
- Onboarding → Settings state: configures setup (evidence: `src/views/onboarding/Onboarding.tsx`)
- AI settings → Settings state: updates provider (evidence: `src/views/settings/AiTab.tsx`)
- AI settings → Tauri command bridge: tests connection (evidence: `src/views/settings/AiTab.tsx`)
- Security settings → Tauri command bridge: requests security actions
- Tauri command bridge → Survival protection: manages protection (evidence: `src-tauri/src/commands.rs`)
- Tauri command bridge → Signed updates: runs update actions (evidence: `src-tauri/src/commands.rs`)
- Answer orchestration → Cue Air: publishes answer (evidence: `src/stores/answer.ts`)
- Cue Test Lab → Prompt library: offers prompt library
