# definetlynotai/coucou_windows architecture

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

- Interactive diagram: https://gitdiagram.com/definetlynotai/coucou_windows
- Repository: https://github.com/definetlynotai/coucou_windows

## Overview

CouCou is a Windows desktop companion for local-model chat, with a compact animated mascot interface. The main workflow is user prompt or attachment → chat UI and shared state → Tauri bridge → Rust chat/tool handling → Ollama, local project search, web search, or optional integrations → response in the chat UI. Separate branches cover settings, voice, project indexing, and file uploads. The source index and excerpts support the named modules; several backend and view connections are documented capabilities rather than inspected call paths, so those links are marked unverified or cited to the README.

Main entry points: [`src/views/chat.ts`](https://github.com/definetlynotai/coucou_windows/blob/main/src/views/chat.ts) (Chat View), [`src/island/island.ts`](https://github.com/definetlynotai/coucou_windows/blob/main/src/island/island.ts) (Island Controller), [`src-tauri/src/tools.rs`](https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/tools.rs) (Tool Dispatch), [`src/core/bridge.ts`](https://github.com/definetlynotai/coucou_windows/blob/main/src/core/bridge.ts) (Tauri Bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Mascot Interface"]
  node_island["Island Controller<br/>[island.ts]"]
  node_mascot["Mochi Animator<br/>[engine.ts]"]
  node_uploadseq["Upload Animation<br/>[sequence.ts]"]
  node_dom["DOM Helpers<br/>[dom.ts]"]
end

subgraph group_chat["Chat and Agents"]
  node_chatui["Chat View<br/>[chat.ts]"]
  node_state["App State<br/>[state.ts]"]
  node_bridge["Tauri Bridge<br/>[bridge.ts]"]
  node_agents["Agent Profiles<br/>[agents.ts]"]
  node_browserai["Browser Model<br/>[browser-ai.ts]"]
end

subgraph group_backend["Desktop Backend"]
  node_ollama["Ollama Chat<br/>[ollama.rs]"]
  node_tools["Tool Dispatch<br/>[tools.rs]"]
  node_mcp["MCP Servers<br/>[mcp.rs]"]
  node_storage[("Encrypted Storage<br/>[storage.rs]")]
  node_settings["Settings<br/>[settings.rs]"]
end

subgraph group_capabilities["Workspace Features"]
  node_projectindex[("Project Index<br/>[index.rs]")]
  node_web["Web Search<br/>[web.rs]"]
  node_integrations["Service Integrations<br/>[integrations.rs]"]
  node_voice["Voice Features<br/>[voice.ts]"]
  node_upload["Attachment Canvas<br/>[canvas.ts]"]
end

node_user(("User"))
node_ollamasvc{{"Ollama Service"}}
node_browser{{"Chromium Browser"}}

node_user -->|"interacts"| node_island
node_island -.->|"hosts view"| node_chatui
node_island -->|"renders"| node_mascot
node_island -->|"steps animation"| node_uploadseq
node_island -->|"builds elements"| node_dom
node_chatui -->|"sends requests"| node_bridge
node_chatui -->|"reads state"| node_state
node_chatui -->|"uses profiles"| node_agents
node_chatui -->|"uses browser model"| node_browserai
node_state -->|"loads chats"| node_bridge
node_bridge -.->|"invokes chat"| node_ollama
node_ollama -->|"requests model"| node_ollamasvc
node_ollama -.->|"handles tool calls"| node_tools
node_tools -.->|"dispatches MCP"| node_mcp
node_tools -->|"runs project tools"| node_projectindex
node_tools -.->|"runs search tools"| node_web
node_tools -.->|"runs integrations"| node_integrations
node_projectindex -->|"embeds documents"| node_ollamasvc
node_projectindex -->|"reads and writes index"| node_storage
node_settings -.->|"persists preferences"| node_storage
node_browserai -->|"retrieves pages"| node_browser
node_chatui -.->|"supports voice"| node_voice
node_user -->|"attaches files"| node_upload
node_upload -.->|"submits attachment"| node_bridge

click node_island "https://github.com/definetlynotai/coucou_windows/blob/main/src/island/island.ts"
click node_mascot "https://github.com/definetlynotai/coucou_windows/blob/main/src/mochi/engine.ts"
click node_uploadseq "https://github.com/definetlynotai/coucou_windows/blob/main/src/upload/sequence.ts"
click node_dom "https://github.com/definetlynotai/coucou_windows/blob/main/src/views/dom.ts"
click node_chatui "https://github.com/definetlynotai/coucou_windows/blob/main/src/views/chat.ts"
click node_state "https://github.com/definetlynotai/coucou_windows/blob/main/src/core/state.ts"
click node_bridge "https://github.com/definetlynotai/coucou_windows/blob/main/src/core/bridge.ts"
click node_agents "https://github.com/definetlynotai/coucou_windows/blob/main/src/core/agents.ts"
click node_browserai "https://github.com/definetlynotai/coucou_windows/blob/main/src/core/browser-ai.ts"
click node_ollama "https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/ollama.rs"
click node_tools "https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/tools.rs"
click node_mcp "https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/mcp.rs"
click node_storage "https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/storage.rs"
click node_settings "https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/settings.rs"
click node_projectindex "https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/index.rs"
click node_web "https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/web.rs"
click node_integrations "https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/integrations.rs"
click node_voice "https://github.com/definetlynotai/coucou_windows/blob/main/src/core/voice.ts"
click node_upload "https://github.com/definetlynotai/coucou_windows/blob/main/src/upload/canvas.ts"

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_island,node_mascot,node_uploadseq,node_dom,node_user,node_browser toneBlue
class node_chatui,node_state,node_bridge,node_agents,node_browserai toneAmber
class node_ollama,node_tools,node_mcp,node_storage,node_settings toneMint
class node_projectindex,node_web,node_integrations,node_voice,node_upload toneRose
class node_ollamasvc toneIndigo
```

## Components

### Mascot Interface

- [Island Controller](https://github.com/definetlynotai/coucou_windows/blob/main/src/island/island.ts): `src/island/island.ts`
- [Mochi Animator](https://github.com/definetlynotai/coucou_windows/blob/main/src/mochi/engine.ts): `src/mochi/engine.ts`
- [Upload Animation](https://github.com/definetlynotai/coucou_windows/blob/main/src/upload/sequence.ts): `src/upload/sequence.ts`
- [DOM Helpers](https://github.com/definetlynotai/coucou_windows/blob/main/src/views/dom.ts): `src/views/dom.ts`

### Chat and Agents

- [Chat View](https://github.com/definetlynotai/coucou_windows/blob/main/src/views/chat.ts): `src/views/chat.ts`
- [App State](https://github.com/definetlynotai/coucou_windows/blob/main/src/core/state.ts): `src/core/state.ts`
- [Tauri Bridge](https://github.com/definetlynotai/coucou_windows/blob/main/src/core/bridge.ts): `src/core/bridge.ts`
- [Agent Profiles](https://github.com/definetlynotai/coucou_windows/blob/main/src/core/agents.ts): `src/core/agents.ts`
- [Browser Model](https://github.com/definetlynotai/coucou_windows/blob/main/src/core/browser-ai.ts): `src/core/browser-ai.ts`

### Desktop Backend

- [Ollama Chat](https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/ollama.rs): `src-tauri/src/ollama.rs`
- [Tool Dispatch](https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/tools.rs): `src-tauri/src/tools.rs`
- [MCP Servers](https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/mcp.rs): `src-tauri/src/mcp.rs`
- [Encrypted Storage](https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/storage.rs): `src-tauri/src/storage.rs`
- [Settings](https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/settings.rs): `src-tauri/src/settings.rs`

### Workspace Features

- [Project Index](https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/index.rs): `src-tauri/src/index.rs`
- [Web Search](https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/web.rs): `src-tauri/src/web.rs`
- [Service Integrations](https://github.com/definetlynotai/coucou_windows/blob/main/src-tauri/src/integrations.rs): `src-tauri/src/integrations.rs`
- [Voice Features](https://github.com/definetlynotai/coucou_windows/blob/main/src/core/voice.ts): `src/core/voice.ts`
- [Attachment Canvas](https://github.com/definetlynotai/coucou_windows/blob/main/src/upload/canvas.ts): `src/upload/canvas.ts`

### Other components

- **User**
- **Ollama Service**
- **Chromium Browser**

## Connections

- User → Island Controller: interacts (evidence: `README.md`)
- Island Controller → Chat View: hosts view
- Island Controller → Mochi Animator: renders (evidence: `src/island/island.ts`)
- Island Controller → Upload Animation: steps animation (evidence: `src/island/island.ts`)
- Island Controller → DOM Helpers: builds elements (evidence: `src/island/island.ts`)
- Chat View → Tauri Bridge: sends requests (evidence: `src/views/chat.ts`)
- Chat View → App State: reads state (evidence: `src/views/chat.ts`)
- Chat View → Agent Profiles: uses profiles (evidence: `src/views/chat.ts`)
- Chat View → Browser Model: uses browser model (evidence: `src/views/chat.ts`)
- App State → Tauri Bridge: loads chats (evidence: `src/core/state.ts`)
- Tauri Bridge → Ollama Chat: invokes chat
- Ollama Chat → Ollama Service: requests model (evidence: `README.md`)
- Ollama Chat → Tool Dispatch: handles tool calls (evidence: `src-tauri/src/tools.rs`)
- Tool Dispatch → MCP Servers: dispatches MCP (evidence: `src-tauri/src/tools.rs`)
- Tool Dispatch → Project Index: runs project tools (evidence: `src-tauri/src/index.rs`)
- Tool Dispatch → Web Search: runs search tools (evidence: `src-tauri/src/tools.rs`)
- Tool Dispatch → Service Integrations: runs integrations
- Project Index → Ollama Service: embeds documents (evidence: `src-tauri/src/index.rs`)
- Project Index → Encrypted Storage: reads and writes index (evidence: `src-tauri/src/index.rs`)
- Settings → Encrypted Storage: persists preferences (evidence: `src-tauri/src/settings.rs`)
- Browser Model → Chromium Browser: retrieves pages (evidence: `README.md`)
- Chat View → Voice Features: supports voice (evidence: `src/views/chat.ts`)
- User → Attachment Canvas: attaches files (evidence: `README.md`)
- Attachment Canvas → Tauri Bridge: submits attachment
