# buechijonas/masha architecture

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

- Interactive diagram: https://gitdiagram.com/buechijonas/masha
- Repository: https://github.com/buechijonas/masha

## Overview

Masha is a personal desktop assistant layered onto a Hyprland session. The main interaction is through its Quickshell widgets, windows, or Quick-Ask: chat is handed to Claude, while Quick-Ask uses local data, web sources, or Ollama; desktop controls also expose task and settings features. Mode switching coordinates the desktop’s appearance and behavior. The README documents these connections; backend and QML source excerpts were not provided, so the graph does not infer finer implementation details.

Main entry points: [`home/.config/quickshell/masha-window/shell.qml`](https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-window/shell.qml) (Masha windows), [`home/.local/share/masha/userconf.py`](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/userconf.py) (Personal settings), [`home/.local/share/masha/ask.py`](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/ask.py) (Quick-Ask backend), [`home/.local/share/masha/mode.sh`](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/mode.sh) (Mode switching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_widget["Masha widgets<br/>[shell.qml]"]
  node_windows["Masha windows<br/>[shell.qml]"]
  node_quickask_ui["Quick-Ask UI<br/>[shell.qml]"]
  node_shared_ui["Shared chat and palette<br/>[MashaChat.qml]"]
  node_mascot["Mascot overlay<br/>[shell.qml]"]
  node_task_view["Task manager view<br/>[TasksView.qml]"]
  node_feature_views["Weather, news, markets<br/>[masha-window]"]
end

subgraph group_assistant["Assistant backends"]
  node_chat["Claude chat backend<br/>[chat.py]"]
  node_ask["Quick-Ask backend<br/>[ask.py]"]
  node_tasks["Task operations<br/>[tasks.py]"]
  node_info["Local information<br/>[info.py]"]
  node_events["Desktop events<br/>[events.py]"]
  node_alive["Random and patrol<br/>[alive.py]"]
  node_userconf["Personal settings<br/>[userconf.py]"]
end

subgraph group_desktop_control["Desktop control"]
  node_cli["Masha CLI<br/>[masha]"]
  node_mode["Mode switching<br/>[mode.sh]"]
  node_hyprland["Hyprland session<br/>[hyprland.conf]"]
  node_palette["Mode palette<br/>[palette.json]"]
end

subgraph group_integrations["External services"]
  node_claude(("Claude Code"))
  node_ollama(("Ollama"))
  node_web(("Weather, RSS, finance sources"))
end

node_user(("User"))

node_user -->|"uses"| node_widget
node_user -->|"opens"| node_windows
node_user -->|"asks"| node_quickask_ui
node_widget -->|"shares components"| node_shared_ui
node_windows -->|"shares components"| node_shared_ui
node_shared_ui -->|"streams chat"| node_chat
node_chat -->|"sends prompts"| node_claude
node_quickask_ui -->|"submits questions"| node_ask
node_ask -->|"summarizes with"| node_ollama
node_ask -->|"searches sources"| node_web
node_windows -->|"requests tasks"| node_tasks
node_windows -->|"requests information"| node_info
node_windows -->|"shows task manager"| node_task_view
node_windows -->|"shows feature views"| node_feature_views
node_info -->|"fetches information"| node_web
node_cli -->|"switches mode"| node_mode
node_mode -->|"updates desktop"| node_hyprland
node_mode -->|"sets mode colors"| node_palette
node_events -->|"uses session socket"| node_hyprland
node_alive -->|"triggers popups"| node_windows
node_user -->|"sees overlay"| node_mascot
node_userconf -->|"configures"| node_ask
node_userconf -->|"configures"| node_info
node_userconf -->|"configures"| node_widget
node_userconf -->|"provides settings"| node_hyprland

click node_widget "https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-widget/shell.qml"
click node_windows "https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-window/shell.qml"
click node_quickask_ui "https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-ask/shell.qml"
click node_shared_ui "https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-common/MashaChat.qml"
click node_mascot "https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-mascot/shell.qml"
click node_task_view "https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-window/TasksView.qml"
click node_feature_views "https://github.com/buechijonas/masha/tree/main/home/.config/quickshell/masha-window"
click node_chat "https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/chat.py"
click node_ask "https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/ask.py"
click node_tasks "https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/tasks.py"
click node_info "https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/info.py"
click node_events "https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/events.py"
click node_alive "https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/alive.py"
click node_userconf "https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/userconf.py"
click node_cli "https://github.com/buechijonas/masha/blob/main/home/.local/bin/masha"
click node_mode "https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/mode.sh"
click node_hyprland "https://github.com/buechijonas/masha/blob/main/home/.config/hypr/hyprland.conf"
click node_palette "https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-common/palette.json"

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_widget,node_windows,node_quickask_ui,node_shared_ui,node_mascot,node_task_view,node_feature_views,node_user toneBlue
class node_chat,node_ask,node_tasks,node_info,node_events,node_alive,node_userconf toneAmber
class node_cli,node_mode,node_hyprland,node_palette toneMint
class node_claude,node_ollama,node_web toneRose
```

## Components

### Desktop interface

- [Masha widgets](https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-widget/shell.qml): `home/.config/quickshell/masha-widget/shell.qml`
- [Masha windows](https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-window/shell.qml): `home/.config/quickshell/masha-window/shell.qml`
- [Quick-Ask UI](https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-ask/shell.qml): `home/.config/quickshell/masha-ask/shell.qml`
- [Shared chat and palette](https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-common/MashaChat.qml): `home/.config/quickshell/masha-common/MashaChat.qml`
- [Mascot overlay](https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-mascot/shell.qml): `home/.config/quickshell/masha-mascot/shell.qml`
- [Task manager view](https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-window/TasksView.qml): `home/.config/quickshell/masha-window/TasksView.qml`
- [Weather, news, markets](https://github.com/buechijonas/masha/tree/main/home/.config/quickshell/masha-window): `home/.config/quickshell/masha-window`

### Assistant backends

- [Claude chat backend](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/chat.py): `home/.local/share/masha/chat.py`
- [Quick-Ask backend](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/ask.py): `home/.local/share/masha/ask.py`
- [Task operations](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/tasks.py): `home/.local/share/masha/tasks.py`
- [Local information](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/info.py): `home/.local/share/masha/info.py`
- [Desktop events](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/events.py): `home/.local/share/masha/events.py`
- [Random and patrol](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/alive.py): `home/.local/share/masha/alive.py`
- [Personal settings](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/userconf.py): `home/.local/share/masha/userconf.py`

### Desktop control

- [Masha CLI](https://github.com/buechijonas/masha/blob/main/home/.local/bin/masha): `home/.local/bin/masha`
- [Mode switching](https://github.com/buechijonas/masha/blob/main/home/.local/share/masha/mode.sh): `home/.local/share/masha/mode.sh`
- [Hyprland session](https://github.com/buechijonas/masha/blob/main/home/.config/hypr/hyprland.conf): `home/.config/hypr/hyprland.conf`
- [Mode palette](https://github.com/buechijonas/masha/blob/main/home/.config/quickshell/masha-common/palette.json): `home/.config/quickshell/masha-common/palette.json`

### External services

- **Claude Code**
- **Ollama**
- **Weather, RSS, finance sources**

### Other components

- **User**

## Connections

- User → Masha widgets: uses (evidence: `README.md`)
- User → Masha windows: opens (evidence: `README.md`)
- User → Quick-Ask UI: asks (evidence: `README.md`)
- Masha widgets → Shared chat and palette: shares components (evidence: `README.md`)
- Masha windows → Shared chat and palette: shares components (evidence: `README.md`)
- Shared chat and palette → Claude chat backend: streams chat (evidence: `README.md`)
- Claude chat backend → Claude Code: sends prompts (evidence: `README.md`)
- Quick-Ask UI → Quick-Ask backend: submits questions (evidence: `README.md`)
- Quick-Ask backend → Ollama: summarizes with (evidence: `README.md`)
- Quick-Ask backend → Weather, RSS, finance sources: searches sources (evidence: `README.md`)
- Masha windows → Task operations: requests tasks (evidence: `README.md`)
- Masha windows → Local information: requests information (evidence: `README.md`)
- Masha windows → Task manager view: shows task manager (evidence: `README.md`)
- Masha windows → Weather, news, markets: shows feature views (evidence: `README.md`)
- Local information → Weather, RSS, finance sources: fetches information (evidence: `README.md`)
- Masha CLI → Mode switching: switches mode (evidence: `README.md`)
- Mode switching → Hyprland session: updates desktop (evidence: `README.md`)
- Mode switching → Mode palette: sets mode colors (evidence: `README.md`)
- Desktop events → Hyprland session: uses session socket (evidence: `README.md`)
- Random and patrol → Masha windows: triggers popups (evidence: `README.md`)
- User → Mascot overlay: sees overlay (evidence: `README.md`)
- Personal settings → Quick-Ask backend: configures (evidence: `README.md`)
- Personal settings → Local information: configures (evidence: `README.md`)
- Personal settings → Masha widgets: configures (evidence: `README.md`)
- Personal settings → Hyprland session: provides settings (evidence: `README.md`)
