# kowshikkodumuri/munder-difflin architecture

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

- Interactive diagram: https://gitdiagram.com/kowshikkodumuri/munder-difflin
- Repository: https://github.com/kowshikkodumuri/munder-difflin

## Overview

Munder Difflin is a local-first Electron desktop app for running terminal coding agents as a coordinated team. Users configure providers and a hive, give work to Michael (the orchestrator), and monitor agent sessions on an office floor; agents use shared memory and messaging while running in real pseudo-terminals. The README also describes voice interaction, integrations, and scheduled or webhook-triggered work. Source excerpts establish some process and trigger wiring, but many subsystem implementations were not sampled, so uncertain links are omitted or marked unverified.

Main entry points: [`src/main/index.ts`](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/index.ts) (Electron main), [`src/main/hive.ts`](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/hive.ts) (Hive orchestrator), [`src/renderer/src/App.tsx`](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/renderer/src/App.tsx) (Desktop UI), [`src/main/pty.ts`](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/pty.ts) (PTY sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop experience"]
  node_app["Desktop UI<br/>[App.tsx]"]
  node_settings["Provider settings"]
  node_floor["Office floor<br/>[OfficeFloor.tsx]"]
  node_bridge["IPC bridge<br/>[index.ts]"]
end

subgraph group_coordination["Agent coordination"]
  node_main["Electron main<br/>[index.ts]"]
  node_config["Hive configuration<br/>[config.ts]"]
  node_hive["Hive orchestrator<br/>[hive.ts]"]
  node_memory[("Agent memory<br/>[memory.ts]")]
  node_knowledge["Knowledge recall<br/>[knowledge.ts]"]
  node_hooks["Agent hooks<br/>[hooks.ts]"]
end

subgraph group_runtime["Agent runtime"]
  node_provider["Provider catalog<br/>[agentProvider.ts]"]
  node_pty["PTY sessions<br/>[pty.ts]"]
  node_cli["Agent CLIs"]
  node_files["Local workspace<br/>[fs.ts]"]
end

subgraph group_capabilities["Work extensions"]
  node_triggers["Trigger contracts<br/>[triggers.ts]"]
  node_webhooks["Webhook server<br/>[webhook.ts]"]
  node_realtime["Voice actions<br/>[realtimeActions.ts]"]
  node_integrations["Integrations<br/>[integrations.ts]"]
  node_analytics["Analytics<br/>[analytics.ts]"]
  node_telemetry["Telemetry<br/>[telemetry.ts]"]
  node_usage["Usage tracking<br/>[usage.ts]"]
  node_updater["App updater<br/>[updater.ts]"]
end

node_user(("User"))
node_external(("Webhook callers"))

node_user -->|"gives work"| node_app
node_app -->|"shows agents"| node_floor
node_app -.->|"configures engines"| node_settings
node_app -.->|"requests actions"| node_bridge
node_bridge -.->|"invokes IPC"| node_main
node_main -->|"reads settings"| node_config
node_main -->|"coordinates agents"| node_hive
node_main -->|"starts sessions"| node_pty
node_pty -.->|"uses provider commands"| node_provider
node_pty -->|"runs processes"| node_cli
node_hive -->|"uses long-term memory"| node_memory
node_hive -.->|"recalls knowledge"| node_knowledge
node_hive -.->|"uses agent hooks"| node_hooks
node_hive -->|"routes agent work"| node_cli
node_main -->|"serves workspace files"| node_files
node_main -->|"starts webhook server"| node_webhooks
node_external -->|"posts work"| node_webhooks
node_webhooks -->|"submits messages"| node_hive
node_main -.->|"dispatches voice actions"| node_realtime
node_main -->|"validates trigger data"| node_triggers
node_main -->|"uses integration definitions"| node_integrations
node_main -.->|"records activity"| node_analytics
node_main -.->|"records telemetry"| node_telemetry
node_main -.->|"tracks usage"| node_usage
node_main -->|"manages updates"| node_updater

click node_app "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/renderer/src/App.tsx"
click node_settings "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/renderer/src/components/AiEnginesSettings.tsx"
click node_floor "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/renderer/src/scene/office/OfficeFloor.tsx"
click node_bridge "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/preload/index.ts"
click node_main "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/index.ts"
click node_config "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/config.ts"
click node_hive "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/hive.ts"
click node_memory "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/memory.ts"
click node_knowledge "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/knowledge.ts"
click node_hooks "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/hooks.ts"
click node_provider "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/shared/agentProvider.ts"
click node_pty "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/pty.ts"
click node_files "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/fs.ts"
click node_triggers "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/shared/triggers.ts"
click node_webhooks "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/webhook.ts"
click node_realtime "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/realtimeActions.ts"
click node_integrations "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/shared/integrations.ts"
click node_analytics "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/analytics.ts"
click node_telemetry "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/telemetry.ts"
click node_usage "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/usage.ts"
click node_updater "https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/updater.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_app,node_settings,node_floor,node_bridge,node_user toneBlue
class node_main,node_config,node_hive,node_memory,node_knowledge,node_hooks toneAmber
class node_provider,node_pty,node_cli,node_files,node_external toneMint
class node_triggers,node_webhooks,node_realtime,node_integrations,node_analytics,node_telemetry,node_usage,node_updater toneRose
```

## Components

### Desktop experience

- [Desktop UI](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/renderer/src/App.tsx): `src/renderer/src/App.tsx`
- [Provider settings](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/renderer/src/components/AiEnginesSettings.tsx): `src/renderer/src/components/AiEnginesSettings.tsx`
- [Office floor](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/renderer/src/scene/office/OfficeFloor.tsx): `src/renderer/src/scene/office/OfficeFloor.tsx`
- [IPC bridge](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/preload/index.ts): `src/preload/index.ts`

### Agent coordination

- [Electron main](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/index.ts): `src/main/index.ts`
- [Hive configuration](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/config.ts): `src/main/config.ts`
- [Hive orchestrator](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/hive.ts): `src/main/hive.ts`
- [Agent memory](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/memory.ts): `src/main/memory.ts`
- [Knowledge recall](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/knowledge.ts): `src/main/knowledge.ts`
- [Agent hooks](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/hooks.ts): `src/main/hooks.ts`

### Agent runtime

- [Provider catalog](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/shared/agentProvider.ts): `src/shared/agentProvider.ts`
- [PTY sessions](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/pty.ts): `src/main/pty.ts`
- **Agent CLIs**
- [Local workspace](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/fs.ts): `src/main/fs.ts`

### Work extensions

- [Trigger contracts](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/shared/triggers.ts): `src/shared/triggers.ts`
- [Webhook server](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/webhook.ts): `src/main/webhook.ts`
- [Voice actions](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/realtimeActions.ts): `src/main/realtimeActions.ts`
- [Integrations](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/shared/integrations.ts): `src/shared/integrations.ts`
- [Analytics](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/analytics.ts): `src/main/analytics.ts`
- [Telemetry](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/telemetry.ts): `src/main/telemetry.ts`
- [Usage tracking](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/usage.ts): `src/main/usage.ts`
- [App updater](https://github.com/kowshikkodumuri/munder-difflin/blob/main/src/main/updater.ts): `src/main/updater.ts`

### Other components

- **User**
- **Webhook callers**

## Connections

- User → Desktop UI: gives work
- Desktop UI → Office floor: shows agents (evidence: `src/renderer/src/App.tsx`)
- Desktop UI → Provider settings: configures engines
- Desktop UI → IPC bridge: requests actions
- IPC bridge → Electron main: invokes IPC
- Electron main → Hive configuration: reads settings (evidence: `src/main/index.ts`)
- Electron main → Hive orchestrator: coordinates agents (evidence: `src/main/index.ts`)
- Electron main → PTY sessions: starts sessions (evidence: `src/main/index.ts`)
- PTY sessions → Provider catalog: uses provider commands
- PTY sessions → Agent CLIs: runs processes
- Hive orchestrator → Agent memory: uses long-term memory
- Hive orchestrator → Knowledge recall: recalls knowledge
- Hive orchestrator → Agent hooks: uses agent hooks
- Hive orchestrator → Agent CLIs: routes agent work
- Electron main → Local workspace: serves workspace files (evidence: `src/main/index.ts`)
- Electron main → Webhook server: starts webhook server (evidence: `src/main/index.ts`)
- Webhook callers → Webhook server: posts work (evidence: `src/main/webhook.ts`)
- Webhook server → Hive orchestrator: submits messages (evidence: `src/main/index.ts`)
- Electron main → Voice actions: dispatches voice actions (evidence: `src/main/index.ts`)
- Electron main → Trigger contracts: validates trigger data (evidence: `src/main/index.ts`)
- Electron main → Integrations: uses integration definitions (evidence: `src/main/index.ts`)
- Electron main → Analytics: records activity (evidence: `src/main/index.ts`)
- Electron main → Telemetry: records telemetry (evidence: `src/main/index.ts`)
- Electron main → Usage tracking: tracks usage (evidence: `src/main/index.ts`)
- Electron main → App updater: manages updates (evidence: `src/main/index.ts`)
