# gcwing/openbitfun architecture

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

- Interactive diagram: https://gitdiagram.com/gcwing/openbitfun
- Repository: https://github.com/gcwing/openbitfun

## Overview

OpenBitFun is a cross-device agent workspace. A user starts work in a desktop, CLI, or remote client; the agent runtime manages session context, selects and executes tools, and returns results to the conversation. The graph also preserves documented capabilities for harness modes, workspace access, Mini Apps, and remote control. Several product branches are documented but their implementations were not sampled, so those relationships are cited to the README; unsampled internals are represented only where the tree supports a path.

Main entry points: [`src/crates/assembly/core/src/agentic/execution/execution_engine.rs`](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/execution/execution_engine.rs) (Execution engine), [`src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs`](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs) (Tool pipeline), [`src/mobile-web/src/services/RemoteSessionManager.ts`](https://github.com/gcwing/openbitfun/blob/main/src/mobile-web/src/services/RemoteSessionManager.ts) (Remote sessions), [`src/apps/desktop`](https://github.com/gcwing/openbitfun/tree/main/src/apps/desktop) (Desktop app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_desktop["Desktop app"]
  node_cli["CLI"]
  node_webui["Web workspace"]
  node_flowchat[("Conversation state<br/>[FlowChatStore.ts]")]
end

subgraph group_runtime["Agent runtime"]
  node_session["Session model<br/>[message.rs]"]
  node_engine["Execution engine"]
  node_harness["Harness modes"]
  node_workspace["Workspace binding<br/>[workspace.rs]"]
  node_deepreview["Deep review policy"]
  node_editguard["Edit constraints"]
end

subgraph group_tools["Tool execution"]
  node_toolframework["Tool framework<br/>[framework.rs]"]
  node_toolregistry["Tool registry<br/>[registry.rs]"]
  node_pipeline["Tool pipeline<br/>[tool_pipeline.rs]"]
  node_toolcontext["Tool context"]
  node_toolresults[("Tool result storage")]
  node_computeruse["Computer use"]
end

subgraph group_remote["Remote collaboration"]
  node_relay["Relay service"]
  node_mobileclient["Mobile web client"]
  node_relayclient["Relay HTTP client<br/>[RelayHttpClient.ts]"]
  node_remotecontrol["Remote sessions"]
  node_hoststream["Host stream transport<br/>[HostStream.ts]"]
  node_sshstate[("SSH workspace state<br/>[workspace_state.rs]")]
end

subgraph group_extensions["Workspace extensions"]
  node_miniapps["Mini Apps"]
  node_hooks["Agent hooks<br/>[native_hooks.rs]"]
  node_marketplace["Mini App marketplace<br/>[App.tsx]"]
end

node_user(("User"))

node_user -->|"starts work"| node_desktop
node_user -->|"starts work"| node_cli
node_user -->|"controls tasks"| node_webui
node_desktop -.->|"runs tasks"| node_engine
node_cli -->|"shares execution"| node_engine
node_webui -.->|"updates conversation"| node_flowchat
node_flowchat -.->|"holds session view"| node_session
node_engine -->|"manages turns"| node_session
node_engine -->|"applies task mode"| node_harness
node_engine -->|"selects tools"| node_toolregistry
node_toolregistry -->|"registers tools"| node_toolframework
node_engine -->|"executes calls"| node_pipeline
node_pipeline -->|"provides context"| node_toolcontext
node_pipeline -->|"stores results"| node_toolresults
node_pipeline -->|"dispatches tools"| node_computeruse
node_engine -->|"uses workspace"| node_workspace
node_engine -.->|"supports review"| node_deepreview
node_engine -->|"checks edits"| node_editguard
node_mobileclient -.->|"sends requests"| node_relayclient
node_relayclient -->|"backs sessions"| node_remotecontrol
node_remotecontrol -->|"controls host"| node_relay
node_remotecontrol -->|"uses stream"| node_hoststream
node_remotecontrol -.->|"targets workspace"| node_sshstate
node_engine -->|"customizes tasks"| node_hooks
node_engine -->|"builds Mini Apps"| node_miniapps
node_user -->|"discovers apps"| node_marketplace
node_marketplace -.->|"offers apps"| node_miniapps

click node_desktop "https://github.com/gcwing/openbitfun/tree/main/src/apps/desktop"
click node_cli "https://github.com/gcwing/openbitfun/tree/main/src/apps/cli"
click node_webui "https://github.com/gcwing/openbitfun/tree/main/src/web-ui"
click node_flowchat "https://github.com/gcwing/openbitfun/blob/main/src/web-ui/src/flow_chat/store/FlowChatStore.ts"
click node_session "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/core/message.rs"
click node_engine "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/execution/execution_engine.rs"
click node_harness "https://github.com/gcwing/openbitfun/tree/main/src/crates/assembly/core/src/agentic"
click node_workspace "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/workspace.rs"
click node_deepreview "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/deep_review_policy.rs"
click node_editguard "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/execution/edit_constraint_guard.rs"
click node_toolframework "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/framework.rs"
click node_toolregistry "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/registry.rs"
click node_pipeline "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs"
click node_toolcontext "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/tool_context_runtime.rs"
click node_toolresults "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/tool_result_storage.rs"
click node_computeruse "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/computer_use_host.rs"
click node_relay "https://github.com/gcwing/openbitfun/tree/main/src/apps/relay-server"
click node_mobileclient "https://github.com/gcwing/openbitfun/tree/main/src/mobile-web"
click node_relayclient "https://github.com/gcwing/openbitfun/blob/main/src/mobile-web/src/services/RelayHttpClient.ts"
click node_remotecontrol "https://github.com/gcwing/openbitfun/blob/main/src/mobile-web/src/services/RemoteSessionManager.ts"
click node_hoststream "https://github.com/gcwing/openbitfun/blob/main/src/shared/relay-transport/HostStream.ts"
click node_sshstate "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/service/remote_ssh/workspace_state.rs"
click node_miniapps "https://github.com/gcwing/openbitfun/tree/main/src/crates/assembly/core/src/miniapp"
click node_hooks "https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/native_hooks.rs"
click node_marketplace "https://github.com/gcwing/openbitfun/blob/main/src/miniapp-market-web/src/App.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_desktop,node_cli,node_webui,node_flowchat,node_user toneBlue
class node_session,node_engine,node_harness,node_workspace,node_deepreview,node_editguard toneAmber
class node_toolframework,node_toolregistry,node_pipeline,node_toolcontext,node_toolresults,node_computeruse toneMint
class node_relay,node_mobileclient,node_relayclient,node_remotecontrol,node_hoststream,node_sshstate toneRose
class node_miniapps,node_hooks,node_marketplace toneIndigo
```

## Components

### User clients

- [Desktop app](https://github.com/gcwing/openbitfun/tree/main/src/apps/desktop): `src/apps/desktop`
- [CLI](https://github.com/gcwing/openbitfun/tree/main/src/apps/cli): `src/apps/cli`
- [Web workspace](https://github.com/gcwing/openbitfun/tree/main/src/web-ui): `src/web-ui`
- [Conversation state](https://github.com/gcwing/openbitfun/blob/main/src/web-ui/src/flow_chat/store/FlowChatStore.ts): `src/web-ui/src/flow_chat/store/FlowChatStore.ts`

### Agent runtime

- [Session model](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/core/message.rs): `src/crates/assembly/core/src/agentic/core/message.rs`
- [Execution engine](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/execution/execution_engine.rs): `src/crates/assembly/core/src/agentic/execution/execution_engine.rs`
- [Harness modes](https://github.com/gcwing/openbitfun/tree/main/src/crates/assembly/core/src/agentic): `src/crates/assembly/core/src/agentic`
- [Workspace binding](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/workspace.rs): `src/crates/assembly/core/src/agentic/workspace.rs`
- [Deep review policy](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/deep_review_policy.rs): `src/crates/assembly/core/src/agentic/deep_review_policy.rs`
- [Edit constraints](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/execution/edit_constraint_guard.rs): `src/crates/assembly/core/src/agentic/execution/edit_constraint_guard.rs`

### Tool execution

- [Tool framework](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/framework.rs): `src/crates/assembly/core/src/agentic/tools/framework.rs`
- [Tool registry](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/registry.rs): `src/crates/assembly/core/src/agentic/tools/registry.rs`
- [Tool pipeline](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs): `src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs`
- [Tool context](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/tool_context_runtime.rs): `src/crates/assembly/core/src/agentic/tools/tool_context_runtime.rs`
- [Tool result storage](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/tool_result_storage.rs): `src/crates/assembly/core/src/agentic/tools/tool_result_storage.rs`
- [Computer use](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/agentic/tools/computer_use_host.rs): `src/crates/assembly/core/src/agentic/tools/computer_use_host.rs`

### Remote collaboration

- [Relay service](https://github.com/gcwing/openbitfun/tree/main/src/apps/relay-server): `src/apps/relay-server`
- [Mobile web client](https://github.com/gcwing/openbitfun/tree/main/src/mobile-web): `src/mobile-web`
- [Relay HTTP client](https://github.com/gcwing/openbitfun/blob/main/src/mobile-web/src/services/RelayHttpClient.ts): `src/mobile-web/src/services/RelayHttpClient.ts`
- [Remote sessions](https://github.com/gcwing/openbitfun/blob/main/src/mobile-web/src/services/RemoteSessionManager.ts): `src/mobile-web/src/services/RemoteSessionManager.ts`
- [Host stream transport](https://github.com/gcwing/openbitfun/blob/main/src/shared/relay-transport/HostStream.ts): `src/shared/relay-transport/HostStream.ts`
- [SSH workspace state](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/service/remote_ssh/workspace_state.rs): `src/crates/assembly/core/src/service/remote_ssh/workspace_state.rs`

### Workspace extensions

- [Mini Apps](https://github.com/gcwing/openbitfun/tree/main/src/crates/assembly/core/src/miniapp): `src/crates/assembly/core/src/miniapp`
- [Agent hooks](https://github.com/gcwing/openbitfun/blob/main/src/crates/assembly/core/src/native_hooks.rs): `src/crates/assembly/core/src/native_hooks.rs`
- [Mini App marketplace](https://github.com/gcwing/openbitfun/blob/main/src/miniapp-market-web/src/App.tsx): `src/miniapp-market-web/src/App.tsx`

### Other components

- **User**

## Connections

- User → Desktop app: starts work (evidence: `README.md`)
- User → CLI: starts work (evidence: `README.md`)
- User → Web workspace: controls tasks (evidence: `README.md`)
- Desktop app → Execution engine: runs tasks (evidence: `README.md`)
- CLI → Execution engine: shares execution (evidence: `README.md`)
- Web workspace → Conversation state: updates conversation (evidence: `src/web-ui/src/flow_chat/hooks/useThreadGoalController.ts`)
- Conversation state → Session model: holds session view
- Execution engine → Session model: manages turns (evidence: `src/crates/assembly/core/src/agentic/execution/execution_engine.rs`)
- Execution engine → Harness modes: applies task mode (evidence: `README.md`)
- Execution engine → Tool registry: selects tools (evidence: `README.md`)
- Tool registry → Tool framework: registers tools (evidence: `src/crates/assembly/core/src/agentic/tools/mod.rs`)
- Execution engine → Tool pipeline: executes calls (evidence: `src/crates/assembly/core/src/agentic/execution/execution_engine.rs`)
- Tool pipeline → Tool context: provides context (evidence: `src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs`)
- Tool pipeline → Tool result storage: stores results (evidence: `src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs`)
- Tool pipeline → Computer use: dispatches tools (evidence: `src/crates/assembly/core/src/agentic/tools/pipeline/tool_pipeline.rs`)
- Execution engine → Workspace binding: uses workspace (evidence: `README.md`)
- Execution engine → Deep review policy: supports review (evidence: `README.md`)
- Execution engine → Edit constraints: checks edits (evidence: `src/crates/assembly/core/src/agentic/execution/execution_engine.rs`)
- Mobile web client → Relay HTTP client: sends requests (evidence: `src/mobile-web/src/services/RemoteSessionManager.ts`)
- Relay HTTP client → Remote sessions: backs sessions (evidence: `src/mobile-web/src/services/RemoteSessionManager.ts`)
- Remote sessions → Relay service: controls host (evidence: `README.md`)
- Remote sessions → Host stream transport: uses stream (evidence: `src/mobile-web/src/services/RemoteSessionManager.ts`)
- Remote sessions → SSH workspace state: targets workspace (evidence: `README.md`)
- Execution engine → Agent hooks: customizes tasks (evidence: `README.md`)
- Execution engine → Mini Apps: builds Mini Apps (evidence: `README.md`)
- User → Mini App marketplace: discovers apps (evidence: `README.md`)
- Mini App marketplace → Mini Apps: offers apps (evidence: `README.md`)
