# kovacevicemir/all-in-one-ai-office architecture

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

- Interactive diagram: https://gitdiagram.com/kovacevicemir/all-in-one-ai-office
- Repository: https://github.com/kovacevicemir/all-in-one-ai-office

## Overview

AI Office provides a live, local-first dashboard for coordinating coding agents. Users configure agents and task queues, start work, then inspect activity, dependencies, context pressure, and terminal output; they can steer live runs and arrange the office floor. The runtime composes the domain with harness, model, session, and persistence adapters, and exposes it to the web client over HTTP and WebSocket. The README documents voice prompting and floor-plan editing; source excerpts do not show their complete UI wiring.

Main entry points: [`apps/runtime/src/index.ts`](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/runtime/src/index.ts) (Runtime composition), [`apps/web/src/App.tsx`](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/App.tsx) (Office app), [`packages/core/src/office.ts`](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/core/src/office.ts) (Office orchestration), [`apps/web/src/runtime/client.ts`](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/runtime/client.ts) (Runtime client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Office app<br/>[App.tsx]"]
  node_scene["Office scene<br/>[OfficeScene.tsx]"]
  node_admin["Staff controls<br/>[AdminPanel.tsx]"]
  node_inspector["Agent inspector<br/>[Inspector.tsx]"]
  node_runtimeclient["Runtime client<br/>[client.ts]"]
  node_poses["Agent placement<br/>[use-poses.ts]"]
  node_layout["Floor-plan editing<br/>[layout-document.ts]"]
  node_posepersist["Pose persistence<br/>[pose-storage.ts]"]
end

subgraph group_runtime["Runtime service"]
  node_runtime["Runtime composition<br/>[index.ts]"]
  node_http["HTTP API<br/>[http.ts]"]
  node_hub["Realtime hub<br/>[hub.ts]"]
  node_contracts["API contracts<br/>[index.ts]"]
end

subgraph group_domain["Office domain"]
  node_office["Office orchestration<br/>[office.ts]"]
  node_queue["Task dependencies<br/>[queue.ts]"]
  node_communications["Agent communications<br/>[communications.ts]"]
  node_ports["Adapter ports<br/>[ports.ts]"]
end

subgraph group_adapters["Pluggable adapters"]
  node_pi["PI harness<br/>[pi.ts]"]
  node_model["DeepSeek provider<br/>[deepseek.ts]"]
  node_session["Session process<br/>[index.ts]"]
  node_store[("File state store<br/>[index.ts]")]
  node_fake["Fake harness<br/>[index.ts]"]
end

subgraph group_voice["Voice prompting"]
  node_voiceui["Voice prompt flow"]
  node_voiceengine["Browser speech engine<br/>[browser-engine.ts]"]
  node_voiceworker["Whisper worker<br/>[whisper.worker.ts]"]
end

node_operator(("Office operator"))
node_microphone(("Microphone input"))
node_speechmodel["Speech model"]

node_operator -->|"uses"| node_webapp
node_webapp -->|"renders"| node_scene
node_webapp -->|"offers staffing"| node_admin
node_webapp -->|"opens details"| node_inspector
node_webapp -->|"reads and commands"| node_runtimeclient
node_runtimeclient -->|"HTTP and WebSocket"| node_runtime
node_runtime -->|"creates API"| node_http
node_runtime -->|"creates realtime hub"| node_hub
node_runtime -->|"composes domain"| node_office
node_http -->|"routes requests"| node_office
node_hub -->|"publishes events"| node_office
node_runtimeclient -->|"validates messages"| node_contracts
node_http -->|"validates API data"| node_contracts
node_office -->|"selects runnable tasks"| node_queue
node_office -->|"manages handoffs"| node_communications
node_office -->|"uses adapter ports"| node_ports
node_runtime -->|"registers harness"| node_pi
node_runtime -->|"registers provider"| node_model
node_runtime -->|"configures spawning"| node_session
node_runtime -->|"configures persistence"| node_store
node_runtime -.->|"supports offline runs"| node_fake
node_webapp -->|"loads agent poses"| node_poses
node_poses -->|"loads and saves"| node_posepersist
node_operator -->|"edits floor plan"| node_layout
node_microphone -->|"provides speech"| node_voiceui
node_voiceui -.->|"requests transcription"| node_voiceengine
node_voiceengine -->|"sends audio"| node_voiceworker
node_voiceworker -.->|"transcribes locally"| node_speechmodel

click node_webapp "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/App.tsx"
click node_scene "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/office/OfficeScene.tsx"
click node_admin "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/components/AdminPanel.tsx"
click node_inspector "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/components/Inspector.tsx"
click node_runtimeclient "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/runtime/client.ts"
click node_poses "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/office/use-poses.ts"
click node_layout "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/office/layout-document.ts"
click node_posepersist "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/office/pose-storage.ts"
click node_voiceui "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/voice/use-voice-prompt.ts"
click node_voiceengine "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/voice/browser-engine.ts"
click node_voiceworker "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/voice/whisper.worker.ts"
click node_runtime "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/runtime/src/index.ts"
click node_http "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/runtime/src/http.ts"
click node_hub "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/runtime/src/hub.ts"
click node_contracts "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/contracts/src/index.ts"
click node_office "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/core/src/office.ts"
click node_queue "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/core/src/queue.ts"
click node_communications "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/core/src/communications.ts"
click node_ports "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/core/src/ports.ts"
click node_pi "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-pi/src/pi.ts"
click node_model "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-pi/src/deepseek.ts"
click node_session "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-session/src/index.ts"
click node_store "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-store-file/src/index.ts"
click node_fake "https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-fake/src/index.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_webapp,node_scene,node_admin,node_inspector,node_runtimeclient,node_poses,node_layout,node_posepersist toneBlue
class node_runtime,node_http,node_hub,node_contracts toneAmber
class node_office,node_queue,node_communications,node_ports toneMint
class node_pi,node_model,node_session,node_store,node_fake toneRose
class node_voiceui,node_voiceengine,node_voiceworker,node_operator,node_microphone,node_speechmodel toneIndigo
```

## Components

### Web experience

- [Office app](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Office scene](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/office/OfficeScene.tsx): `apps/web/src/office/OfficeScene.tsx`
- [Staff controls](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/components/AdminPanel.tsx): `apps/web/src/components/AdminPanel.tsx`
- [Agent inspector](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/components/Inspector.tsx): `apps/web/src/components/Inspector.tsx`
- [Runtime client](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/runtime/client.ts): `apps/web/src/runtime/client.ts`
- [Agent placement](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/office/use-poses.ts): `apps/web/src/office/use-poses.ts`
- [Floor-plan editing](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/office/layout-document.ts): `apps/web/src/office/layout-document.ts`
- [Pose persistence](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/office/pose-storage.ts): `apps/web/src/office/pose-storage.ts`

### Runtime service

- [Runtime composition](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/runtime/src/index.ts): `apps/runtime/src/index.ts`
- [HTTP API](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/runtime/src/http.ts): `apps/runtime/src/http.ts`
- [Realtime hub](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/runtime/src/hub.ts): `apps/runtime/src/hub.ts`
- [API contracts](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/contracts/src/index.ts): `packages/contracts/src/index.ts`

### Office domain

- [Office orchestration](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/core/src/office.ts): `packages/core/src/office.ts`
- [Task dependencies](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/core/src/queue.ts): `packages/core/src/queue.ts`
- [Agent communications](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/core/src/communications.ts): `packages/core/src/communications.ts`
- [Adapter ports](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/core/src/ports.ts): `packages/core/src/ports.ts`

### Pluggable adapters

- [PI harness](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-pi/src/pi.ts): `packages/adapter-pi/src/pi.ts`
- [DeepSeek provider](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-pi/src/deepseek.ts): `packages/adapter-pi/src/deepseek.ts`
- [Session process](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-session/src/index.ts): `packages/adapter-session/src/index.ts`
- [File state store](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-store-file/src/index.ts): `packages/adapter-store-file/src/index.ts`
- [Fake harness](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/packages/adapter-fake/src/index.ts): `packages/adapter-fake/src/index.ts`

### Voice prompting

- [Voice prompt flow](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/voice/use-voice-prompt.ts): `apps/web/src/voice/use-voice-prompt.ts`
- [Browser speech engine](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/voice/browser-engine.ts): `apps/web/src/voice/browser-engine.ts`
- [Whisper worker](https://github.com/kovacevicemir/all-in-one-ai-office/blob/main/apps/web/src/voice/whisper.worker.ts): `apps/web/src/voice/whisper.worker.ts`

### Other components

- **Office operator**
- **Microphone input**
- **Speech model**

## Connections

- Office operator → Office app: uses (evidence: `README.md`)
- Office app → Office scene: renders (evidence: `apps/web/src/App.tsx`)
- Office app → Staff controls: offers staffing (evidence: `README.md`)
- Office app → Agent inspector: opens details (evidence: `apps/web/src/App.tsx`)
- Office app → Runtime client: reads and commands
- Runtime client → Runtime composition: HTTP and WebSocket (evidence: `README.md`)
- Runtime composition → HTTP API: creates API (evidence: `apps/runtime/src/index.ts`)
- Runtime composition → Realtime hub: creates realtime hub (evidence: `apps/runtime/src/index.ts`)
- Runtime composition → Office orchestration: composes domain (evidence: `apps/runtime/src/index.ts`)
- HTTP API → Office orchestration: routes requests (evidence: `apps/runtime/src/http.ts`)
- Realtime hub → Office orchestration: publishes events (evidence: `apps/runtime/src/hub.ts`)
- Runtime client → API contracts: validates messages (evidence: `apps/web/src/runtime/client.ts`)
- HTTP API → API contracts: validates API data (evidence: `apps/runtime/src/http.ts`)
- Office orchestration → Task dependencies: selects runnable tasks (evidence: `packages/core/src/office.ts`)
- Office orchestration → Agent communications: manages handoffs (evidence: `packages/core/src/office.ts`)
- Office orchestration → Adapter ports: uses adapter ports (evidence: `packages/core/src/office.ts`)
- Runtime composition → PI harness: registers harness (evidence: `apps/runtime/src/index.ts`)
- Runtime composition → DeepSeek provider: registers provider (evidence: `apps/runtime/src/index.ts`)
- Runtime composition → Session process: configures spawning (evidence: `apps/runtime/src/index.ts`)
- Runtime composition → File state store: configures persistence (evidence: `apps/runtime/src/index.ts`)
- Runtime composition → Fake harness: supports offline runs (evidence: `README.md`)
- Office app → Agent placement: loads agent poses (evidence: `apps/web/src/App.tsx`)
- Agent placement → Pose persistence: loads and saves (evidence: `apps/web/src/office/use-poses.ts`)
- Office operator → Floor-plan editing: edits floor plan (evidence: `README.md`)
- Microphone input → Voice prompt flow: provides speech (evidence: `README.md`)
- Voice prompt flow → Browser speech engine: requests transcription
- Browser speech engine → Whisper worker: sends audio (evidence: `apps/web/src/voice/browser-engine.ts`)
- Whisper worker → Speech model: transcribes locally
