# aishervin/oh-my-harness architecture

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

- Interactive diagram: https://gitdiagram.com/aishervin/oh-my-harness
- Repository: https://github.com/aishervin/oh-my-harness

## Overview

Oh-My-Harness bridges OpenCode and a standalone terminal agent to DeepSeek’s web session. The primary workflow accepts chat/tool requests, builds a prompt with persistent skills, obtains a DeepSeek completion using a locally solved proof-of-work challenge, and converts model output to OpenAI-style tool calls and results. Separate login/session handling captures credentials locally. Source excerpts support the bridge, protocol, session client, and PoW relationships; other capability links are included only where the README documents them.

Main entry points: [`py/bridge.py`](https://github.com/aishervin/oh-my-harness/blob/main/py/bridge.py) (HTTP bridge), [`py/agent.py`](https://github.com/aishervin/oh-my-harness/blob/main/py/agent.py) (Terminal agent), [`py/deepseek.py`](https://github.com/aishervin/oh-my-harness/blob/main/py/deepseek.py) (Web session client), [`py/pow.py`](https://github.com/aishervin/oh-my-harness/blob/main/py/pow.py) (PoW solver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Client interfaces"]
  node_provider_config["Model registration"]
end

subgraph group_bridge["Bridge and protocol"]
  node_bridge["HTTP bridge<br/>[bridge.py]"]
  node_protocol["Tool protocol<br/>[protocol.py]"]
  node_skill["Persistent skill<br/>[skill.md]"]
  node_session_file[("Session file<br/>[bridge.py]")]
end

subgraph group_deepseek["DeepSeek session"]
  node_deepseek_client["Web session client<br/>[deepseek.py]"]
  node_pow_solver["PoW solver<br/>[pow.py]"]
  node_pow_kernel["C PoW kernel<br/>[pow_fast.c]"]
  node_deepseek_service{{"DeepSeek web"}}
end

subgraph group_localagent["Standalone agent"]
  node_terminal_agent["Terminal agent<br/>[agent.py]"]
  node_local_tools["Local tool executor<br/>[agent.py]"]
end

node_opencode(("OpenCode"))
node_terminal_user(("Terminal user"))
node_browser_user(("Browser user"))

node_opencode -->|"sends chat"| node_bridge
node_provider_config -->|"registers model"| node_opencode
node_bridge -->|"loads skill"| node_skill
node_bridge -->|"formats and parses"| node_protocol
node_bridge -->|"requests completion"| node_deepseek_client
node_bridge -->|"saves session"| node_session_file
node_deepseek_client -->|"reads session"| node_session_file
node_deepseek_client -->|"requests challenge proof"| node_pow_solver
node_pow_solver -->|"solves challenge"| node_pow_kernel
node_deepseek_client -->|"sends requests"| node_deepseek_service
node_browser_user -->|"imports token"| node_bridge
node_terminal_user -->|"provides task"| node_terminal_agent
node_terminal_agent -->|"sends chat"| node_bridge
node_terminal_agent -->|"parses tool output"| node_protocol
node_terminal_agent -->|"dispatches calls"| node_local_tools
node_local_tools -->|"returns results"| node_terminal_agent

click node_bridge "https://github.com/aishervin/oh-my-harness/blob/main/py/bridge.py"
click node_protocol "https://github.com/aishervin/oh-my-harness/blob/main/py/protocol.py"
click node_skill "https://github.com/aishervin/oh-my-harness/blob/main/skill.md"
click node_session_file "https://github.com/aishervin/oh-my-harness/blob/main/py/bridge.py"
click node_deepseek_client "https://github.com/aishervin/oh-my-harness/blob/main/py/deepseek.py"
click node_pow_solver "https://github.com/aishervin/oh-my-harness/blob/main/py/pow.py"
click node_pow_kernel "https://github.com/aishervin/oh-my-harness/blob/main/py/pow_fast.c"
click node_terminal_agent "https://github.com/aishervin/oh-my-harness/blob/main/py/agent.py"
click node_local_tools "https://github.com/aishervin/oh-my-harness/blob/main/py/agent.py"
click node_provider_config "https://github.com/aishervin/oh-my-harness/blob/main/opencode-provider.json"

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_provider_config,node_terminal_user,node_browser_user toneBlue
class node_bridge,node_protocol,node_skill,node_session_file toneAmber
class node_deepseek_client,node_pow_solver,node_pow_kernel,node_deepseek_service toneMint
class node_terminal_agent,node_local_tools toneRose
class node_opencode toneIndigo
```

## Components

### Client interfaces

- [Model registration](https://github.com/aishervin/oh-my-harness/blob/main/opencode-provider.json): `opencode-provider.json`

### Bridge and protocol

- [HTTP bridge](https://github.com/aishervin/oh-my-harness/blob/main/py/bridge.py): `py/bridge.py`
- [Tool protocol](https://github.com/aishervin/oh-my-harness/blob/main/py/protocol.py): `py/protocol.py`
- [Persistent skill](https://github.com/aishervin/oh-my-harness/blob/main/skill.md): `skill.md`
- [Session file](https://github.com/aishervin/oh-my-harness/blob/main/py/bridge.py): `py/bridge.py`

### DeepSeek session

- [Web session client](https://github.com/aishervin/oh-my-harness/blob/main/py/deepseek.py): `py/deepseek.py`
- [PoW solver](https://github.com/aishervin/oh-my-harness/blob/main/py/pow.py): `py/pow.py`
- [C PoW kernel](https://github.com/aishervin/oh-my-harness/blob/main/py/pow_fast.c): `py/pow_fast.c`
- **DeepSeek web**

### Standalone agent

- [Terminal agent](https://github.com/aishervin/oh-my-harness/blob/main/py/agent.py): `py/agent.py`
- [Local tool executor](https://github.com/aishervin/oh-my-harness/blob/main/py/agent.py): `py/agent.py`

### Other components

- **OpenCode**
- **Terminal user**
- **Browser user**

## Connections

- OpenCode → HTTP bridge: sends chat (evidence: `README.md`)
- Model registration → OpenCode: registers model (evidence: `README.md`)
- HTTP bridge → Persistent skill: loads skill (evidence: `README.md`)
- HTTP bridge → Tool protocol: formats and parses (evidence: `py/bridge.py`)
- HTTP bridge → Web session client: requests completion (evidence: `py/bridge.py`)
- HTTP bridge → Session file: saves session (evidence: `py/bridge.py`)
- Web session client → Session file: reads session (evidence: `py/deepseek.py`)
- Web session client → PoW solver: requests challenge proof (evidence: `py/deepseek.py`)
- PoW solver → C PoW kernel: solves challenge (evidence: `py/pow.py`)
- Web session client → DeepSeek web: sends requests (evidence: `py/deepseek.py`)
- Browser user → HTTP bridge: imports token (evidence: `README.md`)
- Terminal user → Terminal agent: provides task (evidence: `README.md`)
- Terminal agent → HTTP bridge: sends chat (evidence: `py/agent.py`)
- Terminal agent → Tool protocol: parses tool output (evidence: `py/agent.py`)
- Terminal agent → Local tool executor: dispatches calls (evidence: `py/agent.py`)
- Local tool executor → Terminal agent: returns results (evidence: `py/agent.py`)
