# giuliastro/harness-remote architecture

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

- Interactive diagram: https://gitdiagram.com/giuliastro/harness-remote
- Repository: https://github.com/giuliastro/harness-remote

## Overview

Harness Remote is a local-first control plane for discovering, observing, and controlling native coding-agent Sessions across machines and desktop, web, and Android clients. The main flow is a user selecting a Machine and Project, discovering or creating a native Session, then observing and controlling it through the gateway; continuation can route work to another agent or machine. The graph also shows the task/worktree runtime and client shells. Some subsystem links are documented capabilities rather than sampled implementation calls; those are marked dashed or supported by the README.

Main entry points: [`bridge/src/server.js`](https://github.com/giuliastro/harness-remote/blob/main/bridge/src/server.js) (Gateway server), [`web/src/api.ts`](https://github.com/giuliastro/harness-remote/blob/main/web/src/api.ts) (Gateway API client), [`web/src/components/native-session-home-base.tsx`](https://github.com/giuliastro/harness-remote/blob/main/web/src/components/native-session-home-base.tsx) (Session workspace), [`web/src/native-session-discovery.ts`](https://github.com/giuliastro/harness-remote/blob/main/web/src/native-session-discovery.ts) (Session discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client applications"]
  node_workspace["Workspace shell"]
  node_webapp["Web app bootstrap<br/>[main.tsx]"]
  node_desktop["Desktop runtime<br/>[main.ts]"]
  node_android["Android pairing"]
end

subgraph group_session["Native Session experience"]
  node_machineconfig["Machine configuration"]
  node_machineapi["Machine API client<br/>[machineClient.ts]"]
  node_sessionhome["Session workspace"]
  node_discovery["Session discovery"]
  node_observer["Session observer"]
  node_routing["Session control and routing"]
  node_webapi["Gateway API client<br/>[api.ts]"]
end

subgraph group_gateway["Machine gateway"]
  node_gatewayserver["Gateway server<br/>[server.js]"]
  node_agentrouter["Agent router<br/>[agent-router.js]"]
  node_acp["Agent session service<br/>[acp-service.js]"]
  node_models["Model catalog"]
  node_profiles["Harness profiles"]
end

subgraph group_continuity["Work continuity"]
  node_taskclient["Task API client<br/>[taskClient.ts]"]
  node_taskcontroller["Task run controller"]
  node_taskcontext["Task context<br/>[task-context.js]"]
  node_worktrees["Git worktrees"]
  node_crossmachine["Cross-machine continuation"]
end

node_user(("User"))
node_machines[("Remote Machines")]

node_user -->|"uses"| node_workspace
node_webapp -->|"renders"| node_workspace
node_workspace -->|"loads"| node_machineconfig
node_workspace -->|"presents"| node_sessionhome
node_sessionhome -->|"lists projects"| node_machineapi
node_sessionhome -->|"discovers sessions"| node_discovery
node_sessionhome -.->|"connects to"| node_machines
node_sessionhome -->|"creates sessions"| node_discovery
node_discovery -->|"requests session data"| node_webapi
node_observer -->|"loads and controls"| node_webapi
node_observer -->|"resolves session"| node_discovery
node_observer -->|"supports task views"| node_taskclient
node_routing -->|"resolves target"| node_discovery
node_routing -->|"loads messages"| node_webapi
node_routing -.->|"continues across machines"| node_crossmachine
node_webapi -.->|"sends gateway requests"| node_gatewayserver
node_machineapi -.->|"sends Machine requests"| node_gatewayserver
node_desktop -->|"transports requests"| node_webapi
node_desktop -->|"handles desktop requests"| node_webapi
node_android -.->|"pairs device"| node_machines
node_gatewayserver -->|"serves agent control"| node_acp
node_gatewayserver -->|"loads profiles"| node_profiles
node_acp -->|"uses model catalog"| node_models
node_agentrouter -.->|"routes requests"| node_gatewayserver
node_taskclient -.->|"calls task endpoints"| node_gatewayserver
node_taskcontroller -->|"builds handoff context"| node_taskcontext
node_taskcontroller -->|"prepares worktree"| node_worktrees
node_crossmachine -.->|"targets configured machine"| node_machines
node_crossmachine -.->|"routes continuation"| node_routing

click node_workspace "https://github.com/giuliastro/harness-remote/blob/main/web/src/components/standalone-universal-workspace.tsx"
click node_webapp "https://github.com/giuliastro/harness-remote/blob/main/web/src/main.tsx"
click node_desktop "https://github.com/giuliastro/harness-remote/blob/main/web/electron/main.ts"
click node_android "https://github.com/giuliastro/harness-remote/blob/main/web/native-android/PairingScannerPlugin.java"
click node_machineconfig "https://github.com/giuliastro/harness-remote/blob/main/web/src/workspaceMachines.ts"
click node_machineapi "https://github.com/giuliastro/harness-remote/blob/main/web/src/machineClient.ts"
click node_sessionhome "https://github.com/giuliastro/harness-remote/blob/main/web/src/components/native-session-home-base.tsx"
click node_discovery "https://github.com/giuliastro/harness-remote/blob/main/web/src/native-session-discovery.ts"
click node_observer "https://github.com/giuliastro/harness-remote/blob/main/web/src/components/native-session-observer.tsx"
click node_routing "https://github.com/giuliastro/harness-remote/blob/main/web/src/native-session-routing.ts"
click node_webapi "https://github.com/giuliastro/harness-remote/blob/main/web/src/api.ts"
click node_gatewayserver "https://github.com/giuliastro/harness-remote/blob/main/bridge/src/server.js"
click node_agentrouter "https://github.com/giuliastro/harness-remote/blob/main/bridge/src/agent-router.js"
click node_acp "https://github.com/giuliastro/harness-remote/blob/main/bridge/src/acp-service.js"
click node_models "https://github.com/giuliastro/harness-remote/blob/main/bridge/src/agent-model-catalog.js"
click node_profiles "https://github.com/giuliastro/harness-remote/blob/main/bridge/src/harness-profiles.js"
click node_taskclient "https://github.com/giuliastro/harness-remote/blob/main/web/src/taskClient.ts"
click node_taskcontroller "https://github.com/giuliastro/harness-remote/blob/main/bridge/src/task-run-controller.js"
click node_taskcontext "https://github.com/giuliastro/harness-remote/blob/main/bridge/src/task-context.js"
click node_worktrees "https://github.com/giuliastro/harness-remote/blob/main/bridge/src/worktree-manager.js"
click node_crossmachine "https://github.com/giuliastro/harness-remote/blob/main/web/src/cross-machine-continuation.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_workspace,node_webapp,node_desktop,node_android,node_user toneBlue
class node_machineconfig,node_machineapi,node_sessionhome,node_discovery,node_observer,node_routing,node_webapi,node_machines toneAmber
class node_gatewayserver,node_agentrouter,node_acp,node_models,node_profiles toneMint
class node_taskclient,node_taskcontroller,node_taskcontext,node_worktrees,node_crossmachine toneRose
```

## Components

### Client applications

- [Workspace shell](https://github.com/giuliastro/harness-remote/blob/main/web/src/components/standalone-universal-workspace.tsx): `web/src/components/standalone-universal-workspace.tsx`
- [Web app bootstrap](https://github.com/giuliastro/harness-remote/blob/main/web/src/main.tsx): `web/src/main.tsx`
- [Desktop runtime](https://github.com/giuliastro/harness-remote/blob/main/web/electron/main.ts): `web/electron/main.ts`
- [Android pairing](https://github.com/giuliastro/harness-remote/blob/main/web/native-android/PairingScannerPlugin.java): `web/native-android/PairingScannerPlugin.java`

### Native Session experience

- [Machine configuration](https://github.com/giuliastro/harness-remote/blob/main/web/src/workspaceMachines.ts): `web/src/workspaceMachines.ts`
- [Machine API client](https://github.com/giuliastro/harness-remote/blob/main/web/src/machineClient.ts): `web/src/machineClient.ts`
- [Session workspace](https://github.com/giuliastro/harness-remote/blob/main/web/src/components/native-session-home-base.tsx): `web/src/components/native-session-home-base.tsx`
- [Session discovery](https://github.com/giuliastro/harness-remote/blob/main/web/src/native-session-discovery.ts): `web/src/native-session-discovery.ts`
- [Session observer](https://github.com/giuliastro/harness-remote/blob/main/web/src/components/native-session-observer.tsx): `web/src/components/native-session-observer.tsx`
- [Session control and routing](https://github.com/giuliastro/harness-remote/blob/main/web/src/native-session-routing.ts): `web/src/native-session-routing.ts`
- [Gateway API client](https://github.com/giuliastro/harness-remote/blob/main/web/src/api.ts): `web/src/api.ts`

### Machine gateway

- [Gateway server](https://github.com/giuliastro/harness-remote/blob/main/bridge/src/server.js): `bridge/src/server.js`
- [Agent router](https://github.com/giuliastro/harness-remote/blob/main/bridge/src/agent-router.js): `bridge/src/agent-router.js`
- [Agent session service](https://github.com/giuliastro/harness-remote/blob/main/bridge/src/acp-service.js): `bridge/src/acp-service.js`
- [Model catalog](https://github.com/giuliastro/harness-remote/blob/main/bridge/src/agent-model-catalog.js): `bridge/src/agent-model-catalog.js`
- [Harness profiles](https://github.com/giuliastro/harness-remote/blob/main/bridge/src/harness-profiles.js): `bridge/src/harness-profiles.js`

### Work continuity

- [Task API client](https://github.com/giuliastro/harness-remote/blob/main/web/src/taskClient.ts): `web/src/taskClient.ts`
- [Task run controller](https://github.com/giuliastro/harness-remote/blob/main/bridge/src/task-run-controller.js): `bridge/src/task-run-controller.js`
- [Task context](https://github.com/giuliastro/harness-remote/blob/main/bridge/src/task-context.js): `bridge/src/task-context.js`
- [Git worktrees](https://github.com/giuliastro/harness-remote/blob/main/bridge/src/worktree-manager.js): `bridge/src/worktree-manager.js`
- [Cross-machine continuation](https://github.com/giuliastro/harness-remote/blob/main/web/src/cross-machine-continuation.ts): `web/src/cross-machine-continuation.ts`

### Other components

- **User**
- **Remote Machines**

## Connections

- User → Workspace shell: uses (evidence: `README.md`)
- Web app bootstrap → Workspace shell: renders (evidence: `web/src/main.tsx`)
- Workspace shell → Machine configuration: loads (evidence: `web/src/main.tsx`)
- Workspace shell → Session workspace: presents
- Session workspace → Machine API client: lists projects (evidence: `web/src/components/native-session-home-base.tsx`)
- Session workspace → Session discovery: discovers sessions (evidence: `web/src/components/native-session-home-base.tsx`)
- Session workspace → Remote Machines: connects to (evidence: `README.md`)
- Session workspace → Session discovery: creates sessions (evidence: `web/src/components/native-session-home-base.tsx`)
- Session discovery → Gateway API client: requests session data (evidence: `web/src/native-session-discovery.ts`)
- Session observer → Gateway API client: loads and controls (evidence: `web/src/components/native-session-observer.tsx`)
- Session observer → Session discovery: resolves session (evidence: `web/src/components/native-session-observer.tsx`)
- Session observer → Task API client: supports task views (evidence: `web/src/components/native-session-observer.tsx`)
- Session control and routing → Session discovery: resolves target (evidence: `web/src/native-session-routing.ts`)
- Session control and routing → Gateway API client: loads messages (evidence: `web/src/native-session-routing.ts`)
- Session control and routing → Cross-machine continuation: continues across machines (evidence: `README.md`)
- Gateway API client → Gateway server: sends gateway requests (evidence: `README.md`)
- Machine API client → Gateway server: sends Machine requests (evidence: `README.md`)
- Desktop runtime → Gateway API client: transports requests
- Desktop runtime → Gateway API client: handles desktop requests (evidence: `web/electron/main.ts`)
- Android pairing → Remote Machines: pairs device (evidence: `README.md`)
- Gateway server → Agent session service: serves agent control (evidence: `bridge/src/server.js`)
- Gateway server → Harness profiles: loads profiles (evidence: `bridge/src/server.js`)
- Agent session service → Model catalog: uses model catalog (evidence: `bridge/src/acp-service.js`)
- Agent router → Gateway server: routes requests
- Task API client → Gateway server: calls task endpoints (evidence: `README.md`)
- Task run controller → Task context: builds handoff context (evidence: `bridge/src/task-run-controller.js`)
- Task run controller → Git worktrees: prepares worktree (evidence: `bridge/src/task-run-controller.js`)
- Cross-machine continuation → Remote Machines: targets configured machine (evidence: `README.md`)
- Cross-machine continuation → Session control and routing: routes continuation (evidence: `README.md`)
