# marmottajr/habblaud architecture

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

- Interactive diagram: https://gitdiagram.com/marmottajr/habblaud
- Repository: https://github.com/marmottajr/habblaud

## Overview

Habblaud is a local virtual-office dashboard for monitoring Claude Code and Codex agents, project rooms, activity, permissions, terminals, deliveries, and account usage. The main flow is local agent/session files into server sources and the office model, then HTTP/SSE data to a browser whose world scene and UI present the live office. Habblaud World is a separate optional social service. Several links are based on README or SOURCE INDEX evidence rather than sampled implementation; uncertain wiring is omitted.

Main entry points: [`server/model/office.ts`](https://github.com/marmottajr/habblaud/blob/main/server/model/office.ts) (Office model), [`client/src/app.ts`](https://github.com/marmottajr/habblaud/blob/main/client/src/app.ts) (Client bootstrap), [`server/http/app.ts`](https://github.com/marmottajr/habblaud/blob/main/server/http/app.ts) (HTTP API), [`server/sources`](https://github.com/marmottajr/habblaud/tree/main/server/sources) (Session sources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Local agent ingestion"]
  node_sources["Session sources"]
  node_transcript["Transcript parsing<br/>[transcript.ts]"]
  node_accounts["Account usage<br/>[service.ts]"]
end

subgraph group_server["Office server"]
  node_office["Office model<br/>[office.ts]"]
  node_http["HTTP API<br/>[app.ts]"]
  node_events["Live event stream<br/>[sse.ts]"]
  node_permissions["Permission requests<br/>[registry.ts]"]
  node_pty["Terminal sessions<br/>[manager.ts]"]
  node_history["Activity history<br/>[timeline.ts]"]
  node_deliveries["Agent deliveries<br/>[deliveries.ts]"]
end

subgraph group_client["Browser office"]
  node_bootstrap["Client bootstrap<br/>[app.ts]"]
  node_store["Office data store<br/>[store.ts]"]
  node_worldstream["World stream client<br/>[world-stream.ts]"]
  node_ui["Dashboard UI<br/>[index.ts]"]
end

subgraph group_art["Pixel world"]
  node_scene["City scene<br/>[index.ts]"]
  node_simulation["Agent simulation<br/>[sim.ts]"]
  node_rendering["Scene rendering<br/>[renderer.ts]"]
  node_art_assets["Pixel art assets<br/>[api.ts]"]
end

subgraph group_social["Habblaud World"]
  node_world_service["World service<br/>[service.ts]"]
  node_world_client["World client<br/>[client.ts]"]
  node_world_protocol["World protocol<br/>[protocol.ts]"]
end

node_user(("Local operator"))
node_agent_files["Agent session files"]
node_browser(("Browser user"))

node_agent_files -->|"reads sessions"| node_sources
node_sources -->|"parses transcripts"| node_transcript
node_sources -->|"updates agents"| node_office
node_accounts -->|"provides usage"| node_office
node_user -->|"opens dashboard"| node_http
node_http -->|"routes requests"| node_office
node_office -->|"commits snapshots"| node_events
node_events -.->|"streams updates"| node_store
node_http -->|"handles decisions"| node_permissions
node_http -->|"routes terminal"| node_pty
node_office -.->|"records activity"| node_history
node_office -.->|"tracks deliveries"| node_deliveries
node_browser -->|"opens app"| node_bootstrap
node_bootstrap -->|"creates store"| node_store
node_bootstrap -->|"creates scene"| node_scene
node_bootstrap -->|"creates panels"| node_ui
node_bootstrap -->|"opens stream"| node_worldstream
node_scene -.->|"runs agents"| node_simulation
node_scene -.->|"renders city"| node_rendering
node_rendering -.->|"uses sprites"| node_art_assets
node_office -.->|"provides office data"| node_world_client
node_world_client -->|"uplinks state"| node_world_service
node_world_service -->|"uses protocol"| node_world_protocol

click node_sources "https://github.com/marmottajr/habblaud/tree/main/server/sources"
click node_transcript "https://github.com/marmottajr/habblaud/blob/main/server/sources/transcript.ts"
click node_accounts "https://github.com/marmottajr/habblaud/blob/main/server/accounts/service.ts"
click node_office "https://github.com/marmottajr/habblaud/blob/main/server/model/office.ts"
click node_http "https://github.com/marmottajr/habblaud/blob/main/server/http/app.ts"
click node_events "https://github.com/marmottajr/habblaud/blob/main/server/http/sse.ts"
click node_permissions "https://github.com/marmottajr/habblaud/blob/main/server/permissions/registry.ts"
click node_pty "https://github.com/marmottajr/habblaud/blob/main/server/pty/manager.ts"
click node_history "https://github.com/marmottajr/habblaud/blob/main/server/history/timeline.ts"
click node_deliveries "https://github.com/marmottajr/habblaud/blob/main/server/deliveries/deliveries.ts"
click node_bootstrap "https://github.com/marmottajr/habblaud/blob/main/client/src/app.ts"
click node_store "https://github.com/marmottajr/habblaud/blob/main/client/src/net/store.ts"
click node_worldstream "https://github.com/marmottajr/habblaud/blob/main/client/src/net/world-stream.ts"
click node_ui "https://github.com/marmottajr/habblaud/blob/main/client/src/ui/index.ts"
click node_scene "https://github.com/marmottajr/habblaud/blob/main/client/src/world/city/index.ts"
click node_simulation "https://github.com/marmottajr/habblaud/blob/main/client/src/world/sim/sim.ts"
click node_rendering "https://github.com/marmottajr/habblaud/blob/main/client/src/world/render/renderer.ts"
click node_art_assets "https://github.com/marmottajr/habblaud/blob/main/client/src/art/api.ts"
click node_world_service "https://github.com/marmottajr/habblaud/blob/main/server/world/service.ts"
click node_world_client "https://github.com/marmottajr/habblaud/blob/main/server/world/client.ts"
click node_world_protocol "https://github.com/marmottajr/habblaud/blob/main/shared/world/protocol.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_sources,node_transcript,node_accounts,node_browser toneBlue
class node_office,node_http,node_events,node_permissions,node_pty,node_history,node_deliveries toneAmber
class node_bootstrap,node_store,node_worldstream,node_ui toneMint
class node_scene,node_simulation,node_rendering,node_art_assets toneRose
class node_world_service,node_world_client,node_world_protocol,node_user,node_agent_files toneIndigo
```

## Components

### Local agent ingestion

- [Session sources](https://github.com/marmottajr/habblaud/tree/main/server/sources): `server/sources`
- [Transcript parsing](https://github.com/marmottajr/habblaud/blob/main/server/sources/transcript.ts): `server/sources/transcript.ts`
- [Account usage](https://github.com/marmottajr/habblaud/blob/main/server/accounts/service.ts): `server/accounts/service.ts`

### Office server

- [Office model](https://github.com/marmottajr/habblaud/blob/main/server/model/office.ts): `server/model/office.ts`
- [HTTP API](https://github.com/marmottajr/habblaud/blob/main/server/http/app.ts): `server/http/app.ts`
- [Live event stream](https://github.com/marmottajr/habblaud/blob/main/server/http/sse.ts): `server/http/sse.ts`
- [Permission requests](https://github.com/marmottajr/habblaud/blob/main/server/permissions/registry.ts): `server/permissions/registry.ts`
- [Terminal sessions](https://github.com/marmottajr/habblaud/blob/main/server/pty/manager.ts): `server/pty/manager.ts`
- [Activity history](https://github.com/marmottajr/habblaud/blob/main/server/history/timeline.ts): `server/history/timeline.ts`
- [Agent deliveries](https://github.com/marmottajr/habblaud/blob/main/server/deliveries/deliveries.ts): `server/deliveries/deliveries.ts`

### Browser office

- [Client bootstrap](https://github.com/marmottajr/habblaud/blob/main/client/src/app.ts): `client/src/app.ts`
- [Office data store](https://github.com/marmottajr/habblaud/blob/main/client/src/net/store.ts): `client/src/net/store.ts`
- [World stream client](https://github.com/marmottajr/habblaud/blob/main/client/src/net/world-stream.ts): `client/src/net/world-stream.ts`
- [Dashboard UI](https://github.com/marmottajr/habblaud/blob/main/client/src/ui/index.ts): `client/src/ui/index.ts`

### Pixel world

- [City scene](https://github.com/marmottajr/habblaud/blob/main/client/src/world/city/index.ts): `client/src/world/city/index.ts`
- [Agent simulation](https://github.com/marmottajr/habblaud/blob/main/client/src/world/sim/sim.ts): `client/src/world/sim/sim.ts`
- [Scene rendering](https://github.com/marmottajr/habblaud/blob/main/client/src/world/render/renderer.ts): `client/src/world/render/renderer.ts`
- [Pixel art assets](https://github.com/marmottajr/habblaud/blob/main/client/src/art/api.ts): `client/src/art/api.ts`

### Habblaud World

- [World service](https://github.com/marmottajr/habblaud/blob/main/server/world/service.ts): `server/world/service.ts`
- [World client](https://github.com/marmottajr/habblaud/blob/main/server/world/client.ts): `server/world/client.ts`
- [World protocol](https://github.com/marmottajr/habblaud/blob/main/shared/world/protocol.ts): `shared/world/protocol.ts`

### Other components

- **Local operator**
- **Agent session files**
- **Browser user**

## Connections

- Agent session files → Session sources: reads sessions
- Session sources → Transcript parsing: parses transcripts (evidence: `server/sources/transcript.ts`)
- Session sources → Office model: updates agents (evidence: `server/model/office.ts`)
- Account usage → Office model: provides usage (evidence: `server/model/office.ts`)
- Local operator → HTTP API: opens dashboard
- HTTP API → Office model: routes requests (evidence: `server/http/app.ts`)
- Office model → Live event stream: commits snapshots (evidence: `server/model/office.ts`)
- Live event stream → Office data store: streams updates
- HTTP API → Permission requests: handles decisions (evidence: `server/permissions/registry.ts`)
- HTTP API → Terminal sessions: routes terminal (evidence: `server/pty/manager.ts`)
- Office model → Activity history: records activity
- Office model → Agent deliveries: tracks deliveries
- Browser user → Client bootstrap: opens app (evidence: `client/src/app.ts`)
- Client bootstrap → Office data store: creates store (evidence: `client/src/app.ts`)
- Client bootstrap → City scene: creates scene (evidence: `client/src/app.ts`)
- Client bootstrap → Dashboard UI: creates panels (evidence: `client/src/app.ts`)
- Client bootstrap → World stream client: opens stream (evidence: `client/src/app.ts`)
- City scene → Agent simulation: runs agents
- City scene → Scene rendering: renders city
- Scene rendering → Pixel art assets: uses sprites
- Office model → World client: provides office data
- World client → World service: uplinks state (evidence: `server/world/client.ts`)
- World service → World protocol: uses protocol (evidence: `server/world/service.ts`)
