# iamlukethedev/claw3d architecture

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

- Interactive diagram: https://gitdiagram.com/iamlukethedev/claw3d
- Repository: https://github.com/iamlukethedev/claw3d

## Overview

Claw3D is a self-hosted 3D workspace for observing and interacting with AI-agent teams. The main workflow runs from a user connecting Studio to a supported runtime, through gateway-backed agent state and chat, to live activity in the office and operational surfaces such as tasks and standups. The graph also includes layout editing, local Studio preferences, and the server-side gateway proxy. Relationships are limited to those shown in excerpts or explicitly described in the README; unsampled subsystems are represented by their listed source paths without assuming internal call chains.

Main entry points: [`src/features/agents/screens/AgentsPageScreen.tsx`](https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/screens/AgentsPageScreen.tsx) (Agent fleet UI), [`src/lib/gateway/GatewayClient.ts`](https://github.com/iamlukethedev/claw3d/blob/main/src/lib/gateway/GatewayClient.ts) (Gateway client), [`src/features/agents/state/store.tsx`](https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/state/store.tsx) (Agent state), [`src/features/office/tasks/useTaskBoardController.ts`](https://github.com/iamlukethedev/claw3d/blob/main/src/features/office/tasks/useTaskBoardController.ts) (Task board)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Office experience"]
  node_office["3D office<br/>[OfficeScreen.tsx]"]
  node_office_scene["Office scene<br/>[RetroOffice3D.tsx]"]
  node_builder["Layout builder"]
  node_layout_api["Layout API<br/>[route.ts]"]
end

subgraph group_agents["Agents and runtimes"]
  node_agent_ui["Agent fleet UI"]
  node_agent_store["Agent state<br/>[store.tsx]"]
  node_event_bridge["Runtime events"]
  node_chat_controller["Chat interaction"]
  node_gateway_client["Gateway client<br/>[GatewayClient.ts]"]
  node_runtime_provider["Runtime providers"]
end

subgraph group_operations["Operational tools"]
  node_tasks["Task board"]
  node_task_store[("Shared task store<br/>[shared-store.ts]")]
  node_standup["Standups<br/>[service.ts]"]
  node_github["GitHub review<br/>[github.ts]"]
  node_approvals["Execution approvals"]
  node_skills["Skills marketplace<br/>[marketplace.ts]"]
end

subgraph group_studio["Studio and connectivity"]
  node_proxy["WebSocket proxy<br/>[gateway-proxy.js]"]
  node_server["Studio server<br/>[index.js]"]
  node_settings_api["Studio settings API<br/>[route.ts]"]
  node_settings_store[("Settings storage<br/>[settings-store.ts]")]
end

node_user(("User"))
node_upstream{{"Agent runtime"}}

node_user -->|"manages agents"| node_agent_ui
node_user -->|"views workspace"| node_office
node_agent_ui -->|"connects through"| node_gateway_client
node_gateway_client -->|"selects provider"| node_runtime_provider
node_runtime_provider -->|"connects to"| node_upstream
node_user -->|"opens Studio"| node_server
node_server -->|"routes WebSocket"| node_proxy
node_proxy -->|"proxies WebSocket"| node_upstream
node_event_bridge -->|"updates state"| node_agent_store
node_agent_ui -->|"renders state"| node_agent_store
node_chat_controller -->|"sends chat"| node_gateway_client
node_office -->|"renders scene"| node_office_scene
node_user -->|"edits layout"| node_builder
node_builder -->|"publishes layout"| node_layout_api
node_settings_api -->|"loads and saves"| node_settings_store
node_tasks -->|"reads and writes"| node_task_store
node_tasks -->|"reads agents"| node_agent_store
node_user -->|"runs standups"| node_standup
node_standup -.->|"uses GitHub review"| node_github
node_user -->|"reviews approvals"| node_approvals
node_user -->|"manages skills"| node_skills

click node_office "https://github.com/iamlukethedev/claw3d/blob/main/src/features/office/screens/OfficeScreen.tsx"
click node_office_scene "https://github.com/iamlukethedev/claw3d/blob/main/src/features/retro-office/RetroOffice3D.tsx"
click node_builder "https://github.com/iamlukethedev/claw3d/blob/main/src/features/office/components/OfficeBuilderPanel.tsx"
click node_layout_api "https://github.com/iamlukethedev/claw3d/blob/main/src/app/api/office/layout/route.ts"
click node_agent_ui "https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/screens/AgentsPageScreen.tsx"
click node_agent_store "https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/state/store.tsx"
click node_event_bridge "https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/state/runtimeEventBridge.ts"
click node_chat_controller "https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/operations/useChatInteractionController.ts"
click node_gateway_client "https://github.com/iamlukethedev/claw3d/blob/main/src/lib/gateway/GatewayClient.ts"
click node_runtime_provider "https://github.com/iamlukethedev/claw3d/blob/main/src/lib/runtime/createRuntimeProvider.ts"
click node_proxy "https://github.com/iamlukethedev/claw3d/blob/main/server/gateway-proxy.js"
click node_server "https://github.com/iamlukethedev/claw3d/blob/main/server/index.js"
click node_settings_api "https://github.com/iamlukethedev/claw3d/blob/main/src/app/api/studio/route.ts"
click node_settings_store "https://github.com/iamlukethedev/claw3d/blob/main/src/lib/studio/settings-store.ts"
click node_tasks "https://github.com/iamlukethedev/claw3d/blob/main/src/features/office/tasks/useTaskBoardController.ts"
click node_task_store "https://github.com/iamlukethedev/claw3d/blob/main/src/lib/tasks/shared-store.ts"
click node_standup "https://github.com/iamlukethedev/claw3d/blob/main/src/lib/office/standup/service.ts"
click node_github "https://github.com/iamlukethedev/claw3d/blob/main/src/lib/office/github.ts"
click node_approvals "https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/approvals/execApprovalRuntimeCoordinator.ts"
click node_skills "https://github.com/iamlukethedev/claw3d/blob/main/src/lib/skills/marketplace.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_office,node_office_scene,node_builder,node_layout_api,node_user toneBlue
class node_agent_ui,node_agent_store,node_event_bridge,node_chat_controller,node_gateway_client,node_runtime_provider toneAmber
class node_tasks,node_task_store,node_standup,node_github,node_approvals,node_skills toneMint
class node_proxy,node_server,node_settings_api,node_settings_store toneRose
class node_upstream toneIndigo
```

## Components

### Office experience

- [3D office](https://github.com/iamlukethedev/claw3d/blob/main/src/features/office/screens/OfficeScreen.tsx): `src/features/office/screens/OfficeScreen.tsx`
- [Office scene](https://github.com/iamlukethedev/claw3d/blob/main/src/features/retro-office/RetroOffice3D.tsx): `src/features/retro-office/RetroOffice3D.tsx`
- [Layout builder](https://github.com/iamlukethedev/claw3d/blob/main/src/features/office/components/OfficeBuilderPanel.tsx): `src/features/office/components/OfficeBuilderPanel.tsx`
- [Layout API](https://github.com/iamlukethedev/claw3d/blob/main/src/app/api/office/layout/route.ts): `src/app/api/office/layout/route.ts`

### Agents and runtimes

- [Agent fleet UI](https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/screens/AgentsPageScreen.tsx): `src/features/agents/screens/AgentsPageScreen.tsx`
- [Agent state](https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/state/store.tsx): `src/features/agents/state/store.tsx`
- [Runtime events](https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/state/runtimeEventBridge.ts): `src/features/agents/state/runtimeEventBridge.ts`
- [Chat interaction](https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/operations/useChatInteractionController.ts): `src/features/agents/operations/useChatInteractionController.ts`
- [Gateway client](https://github.com/iamlukethedev/claw3d/blob/main/src/lib/gateway/GatewayClient.ts): `src/lib/gateway/GatewayClient.ts`
- [Runtime providers](https://github.com/iamlukethedev/claw3d/blob/main/src/lib/runtime/createRuntimeProvider.ts): `src/lib/runtime/createRuntimeProvider.ts`

### Operational tools

- [Task board](https://github.com/iamlukethedev/claw3d/blob/main/src/features/office/tasks/useTaskBoardController.ts): `src/features/office/tasks/useTaskBoardController.ts`
- [Shared task store](https://github.com/iamlukethedev/claw3d/blob/main/src/lib/tasks/shared-store.ts): `src/lib/tasks/shared-store.ts`
- [Standups](https://github.com/iamlukethedev/claw3d/blob/main/src/lib/office/standup/service.ts): `src/lib/office/standup/service.ts`
- [GitHub review](https://github.com/iamlukethedev/claw3d/blob/main/src/lib/office/github.ts): `src/lib/office/github.ts`
- [Execution approvals](https://github.com/iamlukethedev/claw3d/blob/main/src/features/agents/approvals/execApprovalRuntimeCoordinator.ts): `src/features/agents/approvals/execApprovalRuntimeCoordinator.ts`
- [Skills marketplace](https://github.com/iamlukethedev/claw3d/blob/main/src/lib/skills/marketplace.ts): `src/lib/skills/marketplace.ts`

### Studio and connectivity

- [WebSocket proxy](https://github.com/iamlukethedev/claw3d/blob/main/server/gateway-proxy.js): `server/gateway-proxy.js`
- [Studio server](https://github.com/iamlukethedev/claw3d/blob/main/server/index.js): `server/index.js`
- [Studio settings API](https://github.com/iamlukethedev/claw3d/blob/main/src/app/api/studio/route.ts): `src/app/api/studio/route.ts`
- [Settings storage](https://github.com/iamlukethedev/claw3d/blob/main/src/lib/studio/settings-store.ts): `src/lib/studio/settings-store.ts`

### Other components

- **User**
- **Agent runtime**

## Connections

- User → Agent fleet UI: manages agents
- User → 3D office: views workspace
- Agent fleet UI → Gateway client: connects through (evidence: `src/lib/gateway/GatewayClient.ts`)
- Gateway client → Runtime providers: selects provider (evidence: `src/lib/gateway/GatewayClient.ts`)
- Runtime providers → Agent runtime: connects to
- User → Studio server: opens Studio
- Studio server → WebSocket proxy: routes WebSocket (evidence: `server/index.js`)
- WebSocket proxy → Agent runtime: proxies WebSocket
- Runtime events → Agent state: updates state (evidence: `src/features/agents/state/runtimeEventBridge.ts`)
- Agent fleet UI → Agent state: renders state
- Chat interaction → Gateway client: sends chat (evidence: `src/features/agents/operations/useChatInteractionController.ts`)
- 3D office → Office scene: renders scene
- User → Layout builder: edits layout
- Layout builder → Layout API: publishes layout
- Studio settings API → Settings storage: loads and saves (evidence: `src/app/api/studio/route.ts`)
- Task board → Shared task store: reads and writes (evidence: `src/features/office/tasks/useTaskBoardController.ts`)
- Task board → Agent state: reads agents (evidence: `src/features/office/tasks/useTaskBoardController.ts`)
- User → Standups: runs standups
- Standups → GitHub review: uses GitHub review (evidence: `src/lib/office/standup/service.ts`)
- User → Execution approvals: reviews approvals
- User → Skills marketplace: manages skills
