# ccch1mneyyy/dsh-tui architecture

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

- Interactive diagram: https://gitdiagram.com/ccch1mneyyy/dsh-tui
- Repository: https://github.com/ccch1mneyyy/dsh-tui

## Overview

dsh-TUI is an interactive terminal application for DeepSeek Harness, with Claude and Codex support. The principal workflow is a user entering a prompt, the app routing work through an agent backend, and streaming the result into the terminal conversation. The README also documents session management, account sign-in, DSH integrations, extensions, and rich terminal presentation. The source excerpts are selective, so links for documented capabilities rely on the README; the graph does not infer call relationships between unsampled modules.

Main entry points: [`src/agent/session.ts`](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/agent/session.ts) (Agent session), [`src/ink/components/App.tsx`](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/ink/components/App.tsx) (Chat interface), [`src/screens/sessionSupervisor/useSessionSupervisor.ts`](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/screens/sessionSupervisor/useSessionSupervisor.ts) (Session manager), [`bin/dsh-tui.js`](https://github.com/ccch1mneyyy/dsh-tui/blob/main/bin/dsh-tui.js) (CLI entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_entry["CLI entry<br/>[dsh-tui.js]"]
  node_app["Terminal app<br/>[App.tsx]"]
  node_adapter["DSH adapter<br/>[index.ts]"]
  node_projection["Conversation projection<br/>[projection.ts]"]
end

subgraph group_agents["Agent backends"]
  node_claude["Claude backend<br/>[side-query.ts]"]
  node_codex["Codex backend<br/>[client.ts]"]
  node_agent["Agent session<br/>[session.ts]"]
end

subgraph group_sessions["Session workflows"]
  node_session["Session manager"]
  node_foreign["Foreign sessions"]
  node_sessiondata["Session metadata<br/>[index.ts]"]
  node_mounts[("Mount ledger<br/>[sessionMounts.ts]")]
end

subgraph group_terminal["Terminal experience"]
  node_chatui["Chat interface<br/>[App.tsx]"]
  node_terminalio["Terminal notifications"]
  node_image["Image inspection"]
  node_sidepanel["Side panels<br/>[useSidePanel.ts]"]
  node_trajectory["Trajectory view"]
end

subgraph group_integrations["Platform integrations"]
  node_pluginstorage[("Plugin storage<br/>[plugin-storage.ts]")]
  node_oauth["Account sign-in<br/>[service.ts]"]
  node_channel["IDE selection channel<br/>[index.ts]"]
end

node_user(("TUI user"))
node_terminal{{"Terminal"}}
node_deepseek{{"DeepSeek Harness"}}
node_externalagents{{"Claude and Codex"}}

node_user -->|"launches"| node_entry
node_entry -->|"starts"| node_app
node_app -->|"composes"| node_adapter
node_user -->|"enters prompts"| node_chatui
node_chatui -->|"submits work"| node_agent
node_agent -->|"runs with"| node_deepseek
node_agent -->|"supports"| node_externalagents
node_agent -->|"projects events"| node_projection
node_projection -->|"renders conversation"| node_chatui
node_user -->|"manages sessions"| node_session
node_session -->|"lists metadata"| node_sessiondata
node_session -->|"reads ownership"| node_mounts
node_user -->|"browses sessions"| node_foreign
node_foreign -.->|"imports on selection"| node_sessiondata
node_chatui -->|"sends notifications"| node_terminalio
node_user -->|"inspects images"| node_image
node_user -->|"opens panels"| node_sidepanel
node_user -->|"views activity"| node_trajectory
node_adapter -.->|"provides storage"| node_pluginstorage
node_user -->|"signs in"| node_oauth
node_oauth -->|"authenticates"| node_externalagents
node_user -->|"shares selection"| node_channel
node_terminalio -->|"writes protocols"| node_terminal

click node_entry "https://github.com/ccch1mneyyy/dsh-tui/blob/main/bin/dsh-tui.js"
click node_app "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/ink/components/App.tsx"
click node_adapter "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/dsh-adapter/index.ts"
click node_projection "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/channel/projection.ts"
click node_claude "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/backends/claude/side-query.ts"
click node_codex "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/backends/codex/rpc/client.ts"
click node_agent "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/agent/session.ts"
click node_session "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/screens/sessionSupervisor/useSessionSupervisor.ts"
click node_foreign "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/screens/sessionSupervisor/useForeignSessions.ts"
click node_sessiondata "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/dsh-adapter/sessions/index.ts"
click node_mounts "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/sessionMounts.ts"
click node_chatui "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/ink/components/App.tsx"
click node_terminalio "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/ink/useTerminalNotification.ts"
click node_image "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/components/messages/useImageInspection.ts"
click node_sidepanel "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/components/sidePanel/useSidePanel.ts"
click node_trajectory "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/components/trajectory/useTrajectoryScope.ts"
click node_pluginstorage "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/dsh-adapter/plugin-storage.ts"
click node_oauth "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/dsh-adapter/oauth/service.ts"
click node_channel "https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/adapter/channel/index.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_entry,node_app,node_adapter,node_projection,node_user toneBlue
class node_claude,node_codex,node_agent toneAmber
class node_session,node_foreign,node_sessiondata,node_mounts toneMint
class node_chatui,node_terminalio,node_image,node_sidepanel,node_trajectory toneRose
class node_pluginstorage,node_oauth,node_channel,node_terminal,node_deepseek,node_externalagents toneIndigo
```

## Components

### Application runtime

- [CLI entry](https://github.com/ccch1mneyyy/dsh-tui/blob/main/bin/dsh-tui.js): `bin/dsh-tui.js`
- [Terminal app](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/ink/components/App.tsx): `src/ink/components/App.tsx`
- [DSH adapter](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/dsh-adapter/index.ts): `src/dsh-adapter/index.ts`
- [Conversation projection](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/channel/projection.ts): `src/channel/projection.ts`

### Agent backends

- [Claude backend](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/backends/claude/side-query.ts): `src/backends/claude/side-query.ts`
- [Codex backend](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/backends/codex/rpc/client.ts): `src/backends/codex/rpc/client.ts`
- [Agent session](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/agent/session.ts): `src/agent/session.ts`

### Session workflows

- [Session manager](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/screens/sessionSupervisor/useSessionSupervisor.ts): `src/screens/sessionSupervisor/useSessionSupervisor.ts`
- [Foreign sessions](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/screens/sessionSupervisor/useForeignSessions.ts): `src/screens/sessionSupervisor/useForeignSessions.ts`
- [Session metadata](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/dsh-adapter/sessions/index.ts): `src/dsh-adapter/sessions/index.ts`
- [Mount ledger](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/sessionMounts.ts): `src/sessionMounts.ts`

### Terminal experience

- [Chat interface](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/ink/components/App.tsx): `src/ink/components/App.tsx`
- [Terminal notifications](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/ink/useTerminalNotification.ts): `src/ink/useTerminalNotification.ts`
- [Image inspection](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/components/messages/useImageInspection.ts): `src/components/messages/useImageInspection.ts`
- [Side panels](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/components/sidePanel/useSidePanel.ts): `src/components/sidePanel/useSidePanel.ts`
- [Trajectory view](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/components/trajectory/useTrajectoryScope.ts): `src/components/trajectory/useTrajectoryScope.ts`

### Platform integrations

- [Plugin storage](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/dsh-adapter/plugin-storage.ts): `src/dsh-adapter/plugin-storage.ts`
- [Account sign-in](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/dsh-adapter/oauth/service.ts): `src/dsh-adapter/oauth/service.ts`
- [IDE selection channel](https://github.com/ccch1mneyyy/dsh-tui/blob/main/src/adapter/channel/index.ts): `src/adapter/channel/index.ts`

### Other components

- **TUI user**
- **Terminal**
- **DeepSeek Harness**
- **Claude and Codex**

## Connections

- TUI user → CLI entry: launches (evidence: `README.md`)
- CLI entry → Terminal app: starts (evidence: `README.md`)
- Terminal app → DSH adapter: composes (evidence: `README.md`)
- TUI user → Chat interface: enters prompts (evidence: `README.md`)
- Chat interface → Agent session: submits work (evidence: `README.md`)
- Agent session → DeepSeek Harness: runs with (evidence: `README.md`)
- Agent session → Claude and Codex: supports (evidence: `README.md`)
- Agent session → Conversation projection: projects events (evidence: `README.md`)
- Conversation projection → Chat interface: renders conversation (evidence: `README.md`)
- TUI user → Session manager: manages sessions (evidence: `README.md`)
- Session manager → Session metadata: lists metadata (evidence: `src/screens/sessionSupervisor/useSessionSupervisor.ts`)
- Session manager → Mount ledger: reads ownership (evidence: `src/screens/sessionSupervisor/useSessionSupervisor.ts`)
- TUI user → Foreign sessions: browses sessions (evidence: `README.md`)
- Foreign sessions → Session metadata: imports on selection
- Chat interface → Terminal notifications: sends notifications (evidence: `README.md`)
- TUI user → Image inspection: inspects images (evidence: `README.md`)
- TUI user → Side panels: opens panels (evidence: `README.md`)
- TUI user → Trajectory view: views activity (evidence: `README.md`)
- DSH adapter → Plugin storage: provides storage
- TUI user → Account sign-in: signs in (evidence: `README.md`)
- Account sign-in → Claude and Codex: authenticates (evidence: `README.md`)
- TUI user → IDE selection channel: shares selection (evidence: `README.md`)
- Terminal notifications → Terminal: writes protocols (evidence: `src/ink/useTerminalNotification.ts`)
