# zhukunpenglinyutong/desktop-cc-gui architecture

> Architecture diagram of the GitHub repository zhukunpenglinyutong/desktop-cc-gui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zhukunpenglinyutong/desktop-cc-gui
- Repository: https://github.com/zhukunpenglinyutong/desktop-cc-gui

## Overview

ccgui is a cross-platform desktop client for running multiple AI coding CLIs against a project. The main workflow is selecting a workspace, engine, and model, sending a prompt, and viewing streamed responses and tool activity; sessions and usage are also tracked. The repository includes dedicated engine adapters plus broader plugin, skill, MCP, mission, Git, and browser features. README claims and the file tree support these branches, but sampled source is incomplete, so uncertain internal wiring is omitted.

Main entry points: [`src/features/chat/ChatPage.tsx`](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/chat/ChatPage.tsx) (Chat interface), [`src-tauri/src/lib.rs`](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/lib.rs) (Tauri commands), [`src/lib/ipc.ts`](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/lib/ipc.ts) (Native IPC), [`src/features/chat/store/engine-events.ts`](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/chat/store/engine-events.ts) (Session and events)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat["Chat workflow"]
  node_chat_ui["Chat interface<br/>[ChatPage.tsx]"]
  node_composer["Prompt composer"]
  node_chat_store["Session and events<br/>[engine-events.ts]"]
  node_chat_state["Chat state<br/>[store.ts]"]
  node_model_picker["Model selection"]
end

subgraph group_backend["Engine backend"]
  node_ipc["Native IPC<br/>[ipc.ts]"]
  node_commands["Tauri commands<br/>[lib.rs]"]
  node_engine_registry["Engine registry<br/>[registry.rs]"]
  node_engine_runtime["Engine adapters<br/>[mod.rs]"]
  node_event_sink["Event delivery<br/>[event_sink.rs]"]
  node_database[("Local state<br/>[db.rs]")]
end

subgraph group_project["Project tools"]
  node_files_git["Files and Git<br/>[git.rs]"]
  node_browser["Embedded browser<br/>[BrowserPane.tsx]"]
  node_terminal["Terminal<br/>[TerminalView.tsx]"]
end

subgraph group_extensions["Extensions"]
  node_skills["Skills hub<br/>[mod.rs]"]
  node_mcp["MCP services<br/>[mod.rs]"]
  node_plugins["Plugin system<br/>[index.ts]"]
  node_plugin_backend["Plugin management<br/>[mod.rs]"]
  node_missions["Mission workflows<br/>[runtime.ts]"]
end

subgraph group_desktop["Desktop services"]
  node_settings["Engine settings<br/>[SettingsPage.tsx]"]
end

node_user(("User"))
node_cli_runtimes{{"AI CLI runtimes"}}

node_user -->|"uses"| node_chat_ui
node_chat_ui -->|"collects prompt"| node_composer
node_composer -->|"submits message"| node_chat_state
node_chat_ui -->|"selects model"| node_model_picker
node_settings -->|"reads and updates config"| node_ipc
node_model_picker -->|"loads catalogs"| node_ipc
node_chat_state -->|"sends chat actions"| node_ipc
node_ipc -->|"invokes commands"| node_commands
node_commands -->|"resolves engine"| node_engine_registry
node_engine_registry -->|"dispatches"| node_engine_runtime
node_engine_runtime -->|"runs CLI protocol"| node_cli_runtimes
node_cli_runtimes -->|"streams events"| node_event_sink
node_event_sink -->|"emits events"| node_ipc
node_ipc -->|"delivers events"| node_chat_store
node_chat_store -->|"updates sessions"| node_chat_state
node_chat_store -->|"records usage"| node_database
node_commands -->|"persists state"| node_database
node_commands -->|"provides project operations"| node_files_git
node_commands -->|"dispatches skill operations"| node_skills
node_commands -->|"dispatches MCP operations"| node_mcp
node_chat_ui -->|"hosts extensions"| node_plugins
node_plugins -->|"manages plugins"| node_plugin_backend
node_chat_ui -->|"opens workflows"| node_missions
node_chat_ui -->|"opens browser"| node_browser
node_chat_ui -->|"opens terminal"| node_terminal

click node_chat_ui "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/chat/ChatPage.tsx"
click node_composer "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/components/application/ai-chat/ai-chat-composer.tsx"
click node_chat_store "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/chat/store/engine-events.ts"
click node_chat_state "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/chat/store.ts"
click node_settings "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/settings/SettingsPage.tsx"
click node_model_picker "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/components/application/ai-chat/engine-model-panel.tsx"
click node_ipc "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/lib/ipc.ts"
click node_commands "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/lib.rs"
click node_engine_registry "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/engine/registry.rs"
click node_engine_runtime "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/engine/mod.rs"
click node_event_sink "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/event_sink.rs"
click node_database "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/db.rs"
click node_files_git "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/git.rs"
click node_skills "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/skills_hub/mod.rs"
click node_mcp "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/mcp/mod.rs"
click node_plugins "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/plugins/index.ts"
click node_plugin_backend "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/plugins/mod.rs"
click node_missions "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/mission/runtime.ts"
click node_browser "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/browser/BrowserPane.tsx"
click node_terminal "https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/terminal/TerminalView.tsx"

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_chat_ui,node_composer,node_chat_store,node_chat_state,node_model_picker,node_user toneBlue
class node_ipc,node_commands,node_engine_registry,node_engine_runtime,node_event_sink,node_database toneAmber
class node_files_git,node_browser,node_terminal toneMint
class node_skills,node_mcp,node_plugins,node_plugin_backend,node_missions toneRose
class node_settings,node_cli_runtimes toneIndigo
```

## Components

### Chat workflow

- [Chat interface](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/chat/ChatPage.tsx): `src/features/chat/ChatPage.tsx`
- [Prompt composer](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/components/application/ai-chat/ai-chat-composer.tsx): `src/components/application/ai-chat/ai-chat-composer.tsx`
- [Session and events](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/chat/store/engine-events.ts): `src/features/chat/store/engine-events.ts`
- [Chat state](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/chat/store.ts): `src/features/chat/store.ts`
- [Model selection](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/components/application/ai-chat/engine-model-panel.tsx): `src/components/application/ai-chat/engine-model-panel.tsx`

### Engine backend

- [Native IPC](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/lib/ipc.ts): `src/lib/ipc.ts`
- [Tauri commands](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Engine registry](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/engine/registry.rs): `src-tauri/src/engine/registry.rs`
- [Engine adapters](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/engine/mod.rs): `src-tauri/src/engine/mod.rs`
- [Event delivery](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/event_sink.rs): `src-tauri/src/event_sink.rs`
- [Local state](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/db.rs): `src-tauri/src/db.rs`

### Project tools

- [Files and Git](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/git.rs): `src-tauri/src/git.rs`
- [Embedded browser](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/browser/BrowserPane.tsx): `src/features/browser/BrowserPane.tsx`
- [Terminal](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/terminal/TerminalView.tsx): `src/features/terminal/TerminalView.tsx`

### Extensions

- [Skills hub](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/skills_hub/mod.rs): `src-tauri/src/skills_hub/mod.rs`
- [MCP services](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/mcp/mod.rs): `src-tauri/src/mcp/mod.rs`
- [Plugin system](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/plugins/index.ts): `src/features/plugins/index.ts`
- [Plugin management](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src-tauri/src/plugins/mod.rs): `src-tauri/src/plugins/mod.rs`
- [Mission workflows](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/mission/runtime.ts): `src/features/mission/runtime.ts`

### Desktop services

- [Engine settings](https://github.com/zhukunpenglinyutong/desktop-cc-gui/blob/main/src/features/settings/SettingsPage.tsx): `src/features/settings/SettingsPage.tsx`

### Other components

- **User**
- **AI CLI runtimes**

## Connections

- User → Chat interface: uses
- Chat interface → Prompt composer: collects prompt
- Prompt composer → Chat state: submits message
- Chat interface → Model selection: selects model
- Engine settings → Native IPC: reads and updates config
- Model selection → Native IPC: loads catalogs
- Chat state → Native IPC: sends chat actions
- Native IPC → Tauri commands: invokes commands
- Tauri commands → Engine registry: resolves engine
- Engine registry → Engine adapters: dispatches
- Engine adapters → AI CLI runtimes: runs CLI protocol
- AI CLI runtimes → Event delivery: streams events
- Event delivery → Native IPC: emits events
- Native IPC → Session and events: delivers events
- Session and events → Chat state: updates sessions
- Session and events → Local state: records usage
- Tauri commands → Local state: persists state
- Tauri commands → Files and Git: provides project operations
- Tauri commands → Skills hub: dispatches skill operations
- Tauri commands → MCP services: dispatches MCP operations
- Chat interface → Plugin system: hosts extensions
- Plugin system → Plugin management: manages plugins
- Chat interface → Mission workflows: opens workflows
- Chat interface → Embedded browser: opens browser
- Chat interface → Terminal: opens terminal
