# bagpotato/coucou-ollama-windows-linux architecture

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

- Interactive diagram: https://gitdiagram.com/bagpotato/coucou-ollama-windows-linux
- Repository: https://github.com/bagpotato/coucou-ollama-windows-linux

## Overview

Coucou is a cross-platform companion for coding-agent sessions: the Mac/Windows app receives agent activity, presents status and approval/chat actions in a compact island, and can sync session and service information to an iPhone. The graph preserves the documented integrations, file-drop, and phone features alongside the main agent workflow. Several subsystems are represented by directory-level nodes because their implementations were not sampled; their links are limited to README-documented behavior or explicit source-index references.

Main entry points: [`windows/src/main.ts`](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/main.ts) (Desktop entry), [`NotchBuddy/Sources/App/AppState.swift`](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/AppState.swift) (App state), [`NotchBuddy/Sources/App/IslandWindowController.swift`](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/IslandWindowController.swift) (Notch interface), [`NotchBuddy/Sources/Phone/PhoneLink.swift`](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/Phone/PhoneLink.swift) (Phone link)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mac["Mac companion"]
  node_mac_hooks["Agent hooks<br/>[HookServer.swift]"]
  node_mac_state["App state<br/>[AppState.swift]"]
  node_mac_island["Notch interface"]
  node_mac_bot["Mochi character<br/>[BotEngine.swift]"]
  node_mac_chat["AI chat"]
  node_mac_upload["File drop flow"]
  node_mac_services["Service integrations"]
  node_phone_sync["iCloud phone sync<br/>[CloudProbe.swift]"]
end

subgraph group_windows["Windows and Linux"]
  node_win_entry["Desktop entry<br/>[main.ts]"]
  node_win_island["Island interface<br/>[island.ts]"]
  node_win_state["UI state<br/>[state.ts]"]
  node_win_bridge["Native bridge<br/>[bridge.ts]"]
  node_win_backend["Tauri backend<br/>[lib.rs]"]
  node_win_hooks["Hook handling<br/>[hooks.rs]"]
  node_win_integrations["Service integrations<br/>[integrations.rs]"]
  node_win_mochi["Mochi engine<br/>[engine.ts]"]
  node_win_upload["Upload animation<br/>[sequence.ts]"]
end

subgraph group_phone["iPhone companion"]
  node_phone_app["iPhone app"]
  node_phone_link["Phone link<br/>[PhoneLink.swift]"]
  node_phone_live["Live activities<br/>[MochiLive.swift]"]
  node_phone_widgets["Widgets"]
end

subgraph group_shared["Shared models"]
  node_pill_catalog["Pill catalog<br/>[PillCatalog.swift]"]
  node_service_data["Service snapshots"]
end

node_user(("User"))
node_agents(("Coding agents"))
node_cloudkit[("Private CloudKit")]

node_agents -->|"send hook events"| node_mac_hooks
node_mac_hooks -->|"update session state"| node_mac_state
node_mac_state -->|"drive interface"| node_mac_island
node_mac_island -->|"animate character"| node_mac_bot
node_user -->|"inspect and act"| node_mac_island
node_mac_island -->|"open chat"| node_mac_chat
node_user -->|"drop a file"| node_mac_upload
node_mac_state -->|"track service data"| node_mac_services
node_mac_services -->|"publish snapshots"| node_service_data
node_mac_state -->|"publish session updates"| node_phone_sync
node_phone_sync -->|"sync privately"| node_cloudkit
node_cloudkit -->|"sync phone data"| node_phone_link
node_phone_app -->|"read sessions"| node_phone_link
node_phone_link -->|"show live state"| node_phone_live
node_phone_link -->|"provide status"| node_phone_widgets
node_phone_app -->|"present alerts"| node_user
node_agents -->|"send hook events"| node_win_hooks
node_win_entry -->|"launch island"| node_win_island
node_win_entry -->|"load settings"| node_win_state
node_win_entry -->|"boot bridge"| node_win_bridge
node_win_entry -->|"register handlers"| node_win_hooks
node_win_entry -->|"register handlers"| node_win_integrations
node_win_bridge -.->|"invoke native commands"| node_win_backend
node_win_backend -->|"dispatch hook commands"| node_win_hooks
node_win_backend -->|"dispatch integration commands"| node_win_integrations
node_win_island -->|"render Mochi"| node_win_mochi
node_win_island -->|"run drop animation"| node_win_upload
node_mac_state -->|"use pill definitions"| node_pill_catalog
node_service_data -->|"reference service catalog"| node_pill_catalog

click node_mac_hooks "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/HookServer.swift"
click node_mac_state "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/AppState.swift"
click node_mac_island "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/IslandWindowController.swift"
click node_mac_bot "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/CoucouKit/BotEngine.swift"
click node_mac_chat "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/ClaudeService.swift"
click node_mac_upload "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/UploadSequenceEngine.swift"
click node_mac_services "https://github.com/bagpotato/coucou-ollama-windows-linux/tree/main/NotchBuddy/Sources/App"
click node_phone_sync "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/PhoneLink/CloudProbe.swift"
click node_phone_app "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/Phone/CoucouPhoneApp.swift"
click node_phone_link "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/Phone/PhoneLink.swift"
click node_phone_live "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/Phone/MochiLive.swift"
click node_phone_widgets "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/Widgets/CoucouWidgets.swift"
click node_win_entry "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/main.ts"
click node_win_island "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/island/island.ts"
click node_win_state "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/core/state.ts"
click node_win_bridge "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/core/bridge.ts"
click node_win_backend "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src-tauri/src/lib.rs"
click node_win_hooks "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src-tauri/src/hooks.rs"
click node_win_integrations "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src-tauri/src/integrations.rs"
click node_win_mochi "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/mochi/engine.ts"
click node_win_upload "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/upload/sequence.ts"
click node_pill_catalog "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/CoucouKit/PillCatalog.swift"
click node_service_data "https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/CoucouKit/ServiceSnapshot.swift"

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_mac_hooks,node_mac_state,node_mac_island,node_mac_bot,node_mac_chat,node_mac_upload,node_mac_services,node_phone_sync,node_user toneBlue
class node_win_entry,node_win_island,node_win_state,node_win_bridge,node_win_backend,node_win_hooks,node_win_integrations,node_win_mochi,node_win_upload,node_cloudkit toneAmber
class node_phone_app,node_phone_link,node_phone_live,node_phone_widgets toneMint
class node_pill_catalog,node_service_data toneRose
class node_agents toneIndigo
```

## Components

### Mac companion

- [Agent hooks](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/HookServer.swift): `NotchBuddy/Sources/App/HookServer.swift`
- [App state](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/AppState.swift): `NotchBuddy/Sources/App/AppState.swift`
- [Notch interface](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/IslandWindowController.swift): `NotchBuddy/Sources/App/IslandWindowController.swift`
- [Mochi character](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/CoucouKit/BotEngine.swift): `NotchBuddy/Sources/CoucouKit/BotEngine.swift`
- [AI chat](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/ClaudeService.swift): `NotchBuddy/Sources/App/ClaudeService.swift`
- [File drop flow](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/UploadSequenceEngine.swift): `NotchBuddy/Sources/App/UploadSequenceEngine.swift`
- [Service integrations](https://github.com/bagpotato/coucou-ollama-windows-linux/tree/main/NotchBuddy/Sources/App): `NotchBuddy/Sources/App`
- [iCloud phone sync](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/App/PhoneLink/CloudProbe.swift): `NotchBuddy/Sources/App/PhoneLink/CloudProbe.swift`

### Windows and Linux

- [Desktop entry](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/main.ts): `windows/src/main.ts`
- [Island interface](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/island/island.ts): `windows/src/island/island.ts`
- [UI state](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/core/state.ts): `windows/src/core/state.ts`
- [Native bridge](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/core/bridge.ts): `windows/src/core/bridge.ts`
- [Tauri backend](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src-tauri/src/lib.rs): `windows/src-tauri/src/lib.rs`
- [Hook handling](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src-tauri/src/hooks.rs): `windows/src-tauri/src/hooks.rs`
- [Service integrations](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src-tauri/src/integrations.rs): `windows/src-tauri/src/integrations.rs`
- [Mochi engine](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/mochi/engine.ts): `windows/src/mochi/engine.ts`
- [Upload animation](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/windows/src/upload/sequence.ts): `windows/src/upload/sequence.ts`

### iPhone companion

- [iPhone app](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/Phone/CoucouPhoneApp.swift): `NotchBuddy/Sources/Phone/CoucouPhoneApp.swift`
- [Phone link](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/Phone/PhoneLink.swift): `NotchBuddy/Sources/Phone/PhoneLink.swift`
- [Live activities](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/Phone/MochiLive.swift): `NotchBuddy/Sources/Phone/MochiLive.swift`
- [Widgets](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/Widgets/CoucouWidgets.swift): `NotchBuddy/Sources/Widgets/CoucouWidgets.swift`

### Shared models

- [Pill catalog](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/CoucouKit/PillCatalog.swift): `NotchBuddy/Sources/CoucouKit/PillCatalog.swift`
- [Service snapshots](https://github.com/bagpotato/coucou-ollama-windows-linux/blob/main/NotchBuddy/Sources/CoucouKit/ServiceSnapshot.swift): `NotchBuddy/Sources/CoucouKit/ServiceSnapshot.swift`

### Other components

- **User**
- **Coding agents**
- **Private CloudKit**

## Connections

- Coding agents → Agent hooks: send hook events (evidence: `README.md`)
- Agent hooks → App state: update session state (evidence: `NotchBuddy/Sources/App/AppState.swift`)
- App state → Notch interface: drive interface (evidence: `NotchBuddy/Sources/App/IslandWindowController.swift`)
- Notch interface → Mochi character: animate character (evidence: `NotchBuddy/Sources/App/IslandWindowController.swift`)
- User → Notch interface: inspect and act (evidence: `README.md`)
- Notch interface → AI chat: open chat (evidence: `README.md`)
- User → File drop flow: drop a file (evidence: `README.md`)
- App state → Service integrations: track service data (evidence: `NotchBuddy/Sources/App/AppState.swift`)
- Service integrations → Service snapshots: publish snapshots (evidence: `NotchBuddy/Sources/App/PhoneLink/ServicePublisher.swift`)
- App state → iCloud phone sync: publish session updates (evidence: `NotchBuddy/Sources/App/PhoneLink/CloudProbe.swift`)
- iCloud phone sync → Private CloudKit: sync privately (evidence: `README.md`)
- Private CloudKit → Phone link: sync phone data (evidence: `README.md`)
- iPhone app → Phone link: read sessions
- Phone link → Live activities: show live state (evidence: `README.md`)
- Phone link → Widgets: provide status (evidence: `README.md`)
- iPhone app → User: present alerts (evidence: `README.md`)
- Coding agents → Hook handling: send hook events (evidence: `README.md`)
- Desktop entry → Island interface: launch island (evidence: `windows/src/main.ts`)
- Desktop entry → UI state: load settings (evidence: `windows/src/main.ts`)
- Desktop entry → Native bridge: boot bridge (evidence: `windows/src/main.ts`)
- Desktop entry → Hook handling: register handlers (evidence: `windows/src/main.ts`)
- Desktop entry → Service integrations: register handlers (evidence: `windows/src/main.ts`)
- Native bridge → Tauri backend: invoke native commands
- Tauri backend → Hook handling: dispatch hook commands (evidence: `windows/src-tauri/src/lib.rs`)
- Tauri backend → Service integrations: dispatch integration commands (evidence: `windows/src-tauri/src/lib.rs`)
- Island interface → Mochi engine: render Mochi (evidence: `windows/src/mochi/engine.ts`)
- Island interface → Upload animation: run drop animation (evidence: `windows/src/island/island.ts`)
- App state → Pill catalog: use pill definitions (evidence: `NotchBuddy/Sources/App/AppState.swift`)
- Service snapshots → Pill catalog: reference service catalog (evidence: `NotchBuddy/Sources/CoucouKit/ServiceSnapshot.swift`)
