# clarklevis1995/dsh-mobile architecture

> Architecture diagram of the GitHub repository clarklevis1995/dsh-mobile, 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/clarklevis1995/dsh-mobile
- Repository: https://github.com/clarklevis1995/dsh-mobile

## Overview

DeepSeek Harness Mobile is a native Android/iOS client for remote Harness workspaces and agent sessions. Users pair a device with a Mobile Gateway, browse workspaces and sessions, then send messages and follow streamed replies, tool activity, history, and trajectories; they can also respond to questions or approvals and manage remote files. The platforms share protocol, state, projection, synchronization, and file-state logic, while each owns its UI and system integrations. README documents both platforms’ broader capabilities; the sampled source is partial, so uncertain internal wiring is omitted.

Main entry points: [`androidApp/src/main/kotlin/com/clarklevis/dsh/android/ui/ConversationScreen.kt`](https://github.com/clarklevis1995/dsh-mobile/blob/main/androidApp/src/main/kotlin/com/clarklevis/dsh/android/ui/ConversationScreen.kt) (Android UI), [`DeepSeekHarnessMobile/Views/RootView.swift`](https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Views/RootView.swift) (iOS UI), [`DeepSeekHarnessMobile/Core/GatewayClient.swift`](https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/GatewayClient.swift) (iOS gateway client), [`shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/SharedConversationStore.kt`](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/SharedConversationStore.kt) (Conversation stores)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Native clients"]
  node_android_ui["Android UI"]
  node_ios_ui["iOS UI<br/>[RootView.swift]"]
  node_android_graph["Android app graph<br/>[AndroidAppGraph.kt]"]
  node_ios_adapter["iOS shared adapter"]
  node_preferences["Platform preferences"]
end

subgraph group_connectivity["Gateway connectivity"]
  node_android_transport["Android WebSocket"]
  node_android_runtime["Gateway runtime<br/>[GatewayRuntime.kt]"]
  node_ios_gateway["iOS gateway client"]
  node_ios_router["iOS frame router"]
  node_protocol["Wire protocol"]
end

subgraph group_shared["Shared business state"]
  node_conversation_store["Conversation stores"]
  node_projection["Conversation projections"]
  node_history["History synchronization"]
  node_trajectory["Trajectory projection"]
end

subgraph group_agent["Agent interaction"]
  node_session_control["Session control"]
  node_approvals["Approval and questions<br/>[ApprovalReducer.kt]"]
  node_notifications["Agent notifications"]
  node_background["Background execution"]
end

subgraph group_workspace["Workspace management"]
  node_workspace_store["Workspace file state"]
  node_code_preview["Code preview support"]
  node_workspace_ui["Workspace and files UI"]
end

node_user(("Mobile user"))
node_gateway_service{{"Mobile Gateway"}}

node_user -->|"uses"| node_android_ui
node_user -->|"uses"| node_ios_ui
node_android_ui -->|"dispatches actions"| node_android_graph
node_ios_ui -->|"initiates requests"| node_ios_gateway
node_android_graph -->|"uses runtime"| node_android_runtime
node_android_runtime -->|"uses transport"| node_android_transport
node_android_transport -->|"exchanges frames"| node_gateway_service
node_ios_gateway -->|"exchanges frames"| node_gateway_service
node_ios_gateway -->|"routes frames"| node_ios_router
node_ios_router -->|"forwards events"| node_ios_adapter
node_android_runtime -->|"decodes frames"| node_protocol
node_ios_router -->|"uses wire types"| node_protocol
node_android_graph -->|"coordinates state"| node_conversation_store
node_ios_adapter -->|"adapts shared stores"| node_conversation_store
node_conversation_store -->|"projects conversation"| node_projection
node_conversation_store -->|"synchronizes history"| node_history
node_conversation_store -->|"projects trajectory"| node_trajectory
node_android_ui -->|"controls sessions"| node_session_control
node_ios_ui -->|"controls sessions"| node_session_control
node_android_ui -->|"responds to requests"| node_approvals
node_ios_ui -->|"responds to requests"| node_approvals
node_android_graph -->|"notifies agent status"| node_notifications
node_ios_gateway -->|"notifies agent status"| node_notifications
node_android_ui -->|"browses files"| node_workspace_ui
node_workspace_ui -->|"manages remote files"| node_workspace_store
node_workspace_store -->|"prepares previews"| node_code_preview
node_ios_ui -->|"reads settings"| node_preferences
node_ios_gateway -->|"tracks active work"| node_background

click node_android_ui "https://github.com/clarklevis1995/dsh-mobile/blob/main/androidApp/src/main/kotlin/com/clarklevis/dsh/android/ui/ConversationScreen.kt"
click node_ios_ui "https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Views/RootView.swift"
click node_android_graph "https://github.com/clarklevis1995/dsh-mobile/blob/main/androidApp/src/main/kotlin/com/clarklevis/dsh/android/AndroidAppGraph.kt"
click node_ios_adapter "https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/KMPSharedAdapter.swift"
click node_android_transport "https://github.com/clarklevis1995/dsh-mobile/blob/main/androidApp/src/main/kotlin/com/clarklevis/dsh/android/platform/OkHttpGatewayTransport.kt"
click node_android_runtime "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/gateway/GatewayRuntime.kt"
click node_ios_gateway "https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/GatewayClient.swift"
click node_ios_router "https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/GatewayFrameRouter.swift"
click node_protocol "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/protocol/GatewayWireDecoder.kt"
click node_conversation_store "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/SharedConversationStore.kt"
click node_projection "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/projection/ConversationProjection.kt"
click node_history "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/sync/HistorySyncEngine.kt"
click node_trajectory "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/projection/TrajectoryProjection.kt"
click node_session_control "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/domain/SessionControlReducer.kt"
click node_approvals "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/domain/ApprovalReducer.kt"
click node_notifications "https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/AgentUserNotificationManager.swift"
click node_workspace_store "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/SharedWorkspaceFileStore.kt"
click node_code_preview "https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/WorkspaceCodePreviewSupport.kt"
click node_workspace_ui "https://github.com/clarklevis1995/dsh-mobile/blob/main/androidApp/src/main/kotlin/com/clarklevis/dsh/android/ui/WorkspaceFilesUi.kt"
click node_preferences "https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/AppPreferences.swift"
click node_background "https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/AgentBackgroundExecutionController.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_android_ui,node_ios_ui,node_android_graph,node_ios_adapter,node_preferences,node_user toneBlue
class node_android_transport,node_android_runtime,node_ios_gateway,node_ios_router,node_protocol toneAmber
class node_conversation_store,node_projection,node_history,node_trajectory toneMint
class node_session_control,node_approvals,node_notifications,node_background toneRose
class node_workspace_store,node_code_preview,node_workspace_ui,node_gateway_service toneIndigo
```

## Components

### Native clients

- [Android UI](https://github.com/clarklevis1995/dsh-mobile/blob/main/androidApp/src/main/kotlin/com/clarklevis/dsh/android/ui/ConversationScreen.kt): `androidApp/src/main/kotlin/com/clarklevis/dsh/android/ui/ConversationScreen.kt`
- [iOS UI](https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Views/RootView.swift): `DeepSeekHarnessMobile/Views/RootView.swift`
- [Android app graph](https://github.com/clarklevis1995/dsh-mobile/blob/main/androidApp/src/main/kotlin/com/clarklevis/dsh/android/AndroidAppGraph.kt): `androidApp/src/main/kotlin/com/clarklevis/dsh/android/AndroidAppGraph.kt`
- [iOS shared adapter](https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/KMPSharedAdapter.swift): `DeepSeekHarnessMobile/Core/KMPSharedAdapter.swift`
- [Platform preferences](https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/AppPreferences.swift): `DeepSeekHarnessMobile/Core/AppPreferences.swift`

### Gateway connectivity

- [Android WebSocket](https://github.com/clarklevis1995/dsh-mobile/blob/main/androidApp/src/main/kotlin/com/clarklevis/dsh/android/platform/OkHttpGatewayTransport.kt): `androidApp/src/main/kotlin/com/clarklevis/dsh/android/platform/OkHttpGatewayTransport.kt`
- [Gateway runtime](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/gateway/GatewayRuntime.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/gateway/GatewayRuntime.kt`
- [iOS gateway client](https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/GatewayClient.swift): `DeepSeekHarnessMobile/Core/GatewayClient.swift`
- [iOS frame router](https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/GatewayFrameRouter.swift): `DeepSeekHarnessMobile/Core/GatewayFrameRouter.swift`
- [Wire protocol](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/protocol/GatewayWireDecoder.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/protocol/GatewayWireDecoder.kt`

### Shared business state

- [Conversation stores](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/SharedConversationStore.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/SharedConversationStore.kt`
- [Conversation projections](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/projection/ConversationProjection.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/projection/ConversationProjection.kt`
- [History synchronization](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/sync/HistorySyncEngine.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/sync/HistorySyncEngine.kt`
- [Trajectory projection](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/projection/TrajectoryProjection.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/projection/TrajectoryProjection.kt`

### Agent interaction

- [Session control](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/domain/SessionControlReducer.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/domain/SessionControlReducer.kt`
- [Approval and questions](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/domain/ApprovalReducer.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/domain/ApprovalReducer.kt`
- [Agent notifications](https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/AgentUserNotificationManager.swift): `DeepSeekHarnessMobile/Core/AgentUserNotificationManager.swift`
- [Background execution](https://github.com/clarklevis1995/dsh-mobile/blob/main/DeepSeekHarnessMobile/Core/AgentBackgroundExecutionController.swift): `DeepSeekHarnessMobile/Core/AgentBackgroundExecutionController.swift`

### Workspace management

- [Workspace file state](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/SharedWorkspaceFileStore.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/SharedWorkspaceFileStore.kt`
- [Code preview support](https://github.com/clarklevis1995/dsh-mobile/blob/main/shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/WorkspaceCodePreviewSupport.kt): `shared/src/commonMain/kotlin/com/clarklevis/dsh/shared/facade/WorkspaceCodePreviewSupport.kt`
- [Workspace and files UI](https://github.com/clarklevis1995/dsh-mobile/blob/main/androidApp/src/main/kotlin/com/clarklevis/dsh/android/ui/WorkspaceFilesUi.kt): `androidApp/src/main/kotlin/com/clarklevis/dsh/android/ui/WorkspaceFilesUi.kt`

### Other components

- **Mobile user**
- **Mobile Gateway**

## Connections

- Mobile user → Android UI: uses
- Mobile user → iOS UI: uses
- Android UI → Android app graph: dispatches actions
- iOS UI → iOS gateway client: initiates requests
- Android app graph → Gateway runtime: uses runtime
- Gateway runtime → Android WebSocket: uses transport
- Android WebSocket → Mobile Gateway: exchanges frames
- iOS gateway client → Mobile Gateway: exchanges frames
- iOS gateway client → iOS frame router: routes frames
- iOS frame router → iOS shared adapter: forwards events
- Gateway runtime → Wire protocol: decodes frames
- iOS frame router → Wire protocol: uses wire types
- Android app graph → Conversation stores: coordinates state
- iOS shared adapter → Conversation stores: adapts shared stores
- Conversation stores → Conversation projections: projects conversation
- Conversation stores → History synchronization: synchronizes history
- Conversation stores → Trajectory projection: projects trajectory
- Android UI → Session control: controls sessions
- iOS UI → Session control: controls sessions
- Android UI → Approval and questions: responds to requests
- iOS UI → Approval and questions: responds to requests
- Android app graph → Agent notifications: notifies agent status
- iOS gateway client → Agent notifications: notifies agent status
- Android UI → Workspace and files UI: browses files
- Workspace and files UI → Workspace file state: manages remote files
- Workspace file state → Code preview support: prepares previews
- iOS UI → Platform preferences: reads settings
- iOS gateway client → Background execution: tracks active work
