# ted-h-com/multi-ai-chat-desktop architecture

> Architecture diagram of the GitHub repository ted-h-com/multi-ai-chat-desktop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ted-h-com/multi-ai-chat-desktop
- Repository: https://github.com/ted-h-com/multi-ai-chat-desktop

## Overview

Multi-AI Chat Desktop is a Tauri workflow hub that coordinates real, signed-in provider web sessions. The user submits a question in the workspace; the app runs a selected preset or mode, sends work to assigned providers, gathers responses, and presents the result in the conversation. Native WebViews and injected provider-page automation enable that work. Supporting capabilities include settings and provider selection, snapshots and replay, session checkpoints, diagnostics, and localization. Edges reflect excerpts, SOURCE INDEX references, or README statements; unsampled subsystem links are omitted where their callers are not shown.

Main entry points: [`src/App.tsx`](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/App.tsx) (Workspace UI), [`src/workflow/index.ts`](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/index.ts) (Workflow entry), [`src-tauri/src/webviews.rs`](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/webviews.rs) (Provider WebViews), [`src/workflow/graph/executor.ts`](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/graph/executor.ts) (Graph executor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_app["Workspace UI<br/>[App.tsx]"]
  node_conversation["Conversation continuity"]
  node_locales["Localization<br/>[t.ts]"]
end

subgraph group_workflow["Workflow orchestration"]
  node_workflow_entry["Workflow entry<br/>[index.ts]"]
  node_graph_executor["Graph executor<br/>[executor.ts]"]
  node_response_language["Response language"]
  node_checkpoint["Workflow checkpoint<br/>[checkpoint.ts]"]
  node_snapshots[("Snapshots and replay")]
end

subgraph group_automation["Provider automation"]
  node_provider_pages["Provider web sessions"]
  node_injected_engine["Page automation engine<br/>[engine.ts]"]
  node_report_digest["Adapter report digest<br/>[reportDigest.ts]"]
end

subgraph group_native["Desktop services"]
  node_host_bridge["Host bridge API<br/>[index.ts]"]
  node_native_webviews["Provider WebViews<br/>[webviews.rs]"]
  node_native_bridge["Native bridge<br/>[bridge.rs]"]
  node_provider_adapters["Adapter management<br/>[adapters.rs]"]
  node_settings[("Settings<br/>[settings.rs]")]
end

subgraph group_support["State and diagnostics"]
  node_event_log[("Event log<br/>[eventLog.ts]")]
  node_broken_report["Broken adapter reporting<br/>[reportBroken.ts]"]
  node_checkpoint_storage[("Session checkpoint storage")]
end

node_user(("User"))

node_user -->|"submits question"| node_app
node_app -->|"starts workflow"| node_workflow_entry
node_workflow_entry -->|"executes graph"| node_graph_executor
node_graph_executor -->|"uses policy"| node_response_language
node_app -->|"loads sessions"| node_conversation
node_app -->|"uses translations"| node_locales
node_workflow_entry -->|"persists snapshots"| node_snapshots
node_app -->|"uses host API"| node_host_bridge
node_host_bridge -->|"invokes commands"| node_native_webviews
node_native_webviews -->|"uses adapters"| node_provider_adapters
node_native_webviews -->|"uses bridge"| node_native_bridge
node_native_webviews -->|"reads settings"| node_settings
node_provider_adapters -.->|"updates page automation"| node_provider_pages
node_provider_pages -.->|"runs injected code"| node_injected_engine
node_injected_engine -->|"builds report digest"| node_report_digest
node_app -->|"records events"| node_event_log
node_app -->|"reports adapter issue"| node_broken_report
node_workflow_entry -.->|"manages checkpoints"| node_checkpoint
node_checkpoint -.->|"saves checkpoint"| node_checkpoint_storage
node_user -->|"signs in"| node_provider_pages

click node_app "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/App.tsx"
click node_conversation "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/ui/conversationContinuity.ts"
click node_locales "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/i18n/t.ts"
click node_workflow_entry "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/index.ts"
click node_graph_executor "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/graph/executor.ts"
click node_response_language "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/responseLanguage.ts"
click node_checkpoint "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/checkpoint.ts"
click node_snapshots "https://github.com/ted-h-com/multi-ai-chat-desktop/tree/main/src/workflow/snapshot"
click node_host_bridge "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/host/index.ts"
click node_native_webviews "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/webviews.rs"
click node_native_bridge "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/bridge.rs"
click node_provider_adapters "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/adapters.rs"
click node_settings "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/settings.rs"
click node_injected_engine "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/injected/engine.ts"
click node_report_digest "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/injected/reportDigest.ts"
click node_event_log "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/diagnostics/eventLog.ts"
click node_broken_report "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/ui/reportBroken.ts"
click node_checkpoint_storage "https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/session_checkpoint.rs"

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_conversation,node_locales,node_user toneBlue
class node_workflow_entry,node_graph_executor,node_response_language,node_checkpoint,node_snapshots toneAmber
class node_provider_pages,node_injected_engine,node_report_digest toneMint
class node_host_bridge,node_native_webviews,node_native_bridge,node_provider_adapters,node_settings toneRose
class node_event_log,node_broken_report,node_checkpoint_storage toneIndigo
```

## Components

### Workspace

- [Workspace UI](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/App.tsx): `src/App.tsx`
- [Conversation continuity](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/ui/conversationContinuity.ts): `src/ui/conversationContinuity.ts`
- [Localization](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/i18n/t.ts): `src/i18n/t.ts`

### Workflow orchestration

- [Workflow entry](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/index.ts): `src/workflow/index.ts`
- [Graph executor](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/graph/executor.ts): `src/workflow/graph/executor.ts`
- [Response language](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/responseLanguage.ts): `src/workflow/responseLanguage.ts`
- [Workflow checkpoint](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/workflow/checkpoint.ts): `src/workflow/checkpoint.ts`
- [Snapshots and replay](https://github.com/ted-h-com/multi-ai-chat-desktop/tree/main/src/workflow/snapshot): `src/workflow/snapshot`

### Provider automation

- **Provider web sessions**
- [Page automation engine](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/injected/engine.ts): `injected/engine.ts`
- [Adapter report digest](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/injected/reportDigest.ts): `injected/reportDigest.ts`

### Desktop services

- [Host bridge API](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/host/index.ts): `src/host/index.ts`
- [Provider WebViews](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/webviews.rs): `src-tauri/src/webviews.rs`
- [Native bridge](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/bridge.rs): `src-tauri/src/bridge.rs`
- [Adapter management](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/adapters.rs): `src-tauri/src/adapters.rs`
- [Settings](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/settings.rs): `src-tauri/src/settings.rs`

### State and diagnostics

- [Event log](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/diagnostics/eventLog.ts): `src/diagnostics/eventLog.ts`
- [Broken adapter reporting](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src/ui/reportBroken.ts): `src/ui/reportBroken.ts`
- [Session checkpoint storage](https://github.com/ted-h-com/multi-ai-chat-desktop/blob/main/src-tauri/src/session_checkpoint.rs): `src-tauri/src/session_checkpoint.rs`

### Other components

- **User**

## Connections

- User → Workspace UI: submits question (evidence: `README.md`)
- Workspace UI → Workflow entry: starts workflow (evidence: `src/App.tsx`)
- Workflow entry → Graph executor: executes graph (evidence: `src/workflow/index.ts`)
- Graph executor → Response language: uses policy (evidence: `src/workflow/graph/executor.ts`)
- Workspace UI → Conversation continuity: loads sessions (evidence: `src/App.tsx`)
- Workspace UI → Localization: uses translations (evidence: `src/App.tsx`)
- Workflow entry → Snapshots and replay: persists snapshots (evidence: `src/workflow/index.ts`)
- Workspace UI → Host bridge API: uses host API (evidence: `src/App.tsx`)
- Host bridge API → Provider WebViews: invokes commands (evidence: `src/host/index.ts`)
- Provider WebViews → Adapter management: uses adapters (evidence: `src-tauri/src/webviews.rs`)
- Provider WebViews → Native bridge: uses bridge (evidence: `src-tauri/src/webviews.rs`)
- Provider WebViews → Settings: reads settings (evidence: `src-tauri/src/webviews.rs`)
- Adapter management → Provider web sessions: updates page automation
- Provider web sessions → Page automation engine: runs injected code
- Page automation engine → Adapter report digest: builds report digest (evidence: `injected/engine.ts`)
- Workspace UI → Event log: records events (evidence: `src/App.tsx`)
- Workspace UI → Broken adapter reporting: reports adapter issue (evidence: `src/App.tsx`)
- Workflow entry → Workflow checkpoint: manages checkpoints
- Workflow checkpoint → Session checkpoint storage: saves checkpoint
- User → Provider web sessions: signs in (evidence: `README.md`)
