# codejunkie99/meridian-company-os architecture

> Architecture diagram of the GitHub repository codejunkie99/meridian-company-os, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/codejunkie99/meridian-company-os
- Repository: https://github.com/codejunkie99/meridian-company-os

## Overview

Meridian OS is a local-first operating console for managing multi-company human/AI teams. Operators navigate the console to inspect company state, create and run work, govern consequential actions, and monitor goals, activity, and spending. A shared store holds the operating model, advances a simulation, and persists snapshots; agent execution can use the local Kimi runtime, while OAuth is an optional separate connection path. The README documents the broader views and integrations; unsampled view internals are represented by their exact paths, with only documented wiring shown.

Main entry points: [`src/App.tsx`](https://github.com/codejunkie99/meridian-company-os/blob/main/src/App.tsx) (App shell), [`src/lib/store.tsx`](https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/store.tsx) (Operating store), [`src/views/Space.tsx`](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Space.tsx) (Kimi Space), [`src/views/Work.tsx`](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Work.tsx) (Work board)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Operator console"]
  node_app["App shell<br/>[App.tsx]"]
  node_palette["Command palette<br/>[CommandPalette.tsx]"]
end

subgraph group_operations["Company operations"]
  node_space["Kimi Space<br/>[Space.tsx]"]
  node_work["Work board<br/>[Work.tsx]"]
  node_goals["Goals view<br/>[Goals.tsx]"]
  node_org["Org chart<br/>[Org.tsx]"]
  node_agents["Agent roster<br/>[Agents.tsx]"]
  node_skills["Skills view<br/>[Skills.tsx]"]
end

subgraph group_governance["Governance and insight"]
  node_approvals["Approvals inbox<br/>[Approvals.tsx]"]
  node_finance["Finance view<br/>[Finance.tsx]"]
  node_activity["Activity log<br/>[Activity.tsx]"]
  node_reports["CEO reports<br/>[Reports.tsx]"]
  node_portfolio["Company portfolio<br/>[Portfolio.tsx]"]
end

subgraph group_state["State and execution"]
  node_store["Operating store<br/>[store.tsx]"]
  node_runtime["Agent runner<br/>[runtime.ts]"]
  node_seed["Seeded companies<br/>[seed.ts]"]
  node_skillsreg["Skill registry<br/>[skills.ts]"]
  node_stateapi["Snapshot API<br/>[stateApi.ts]"]
  node_db[("Local KV store<br/>[db.ts]")]
end

subgraph group_integrations["Kimi integrations"]
  node_kimi["Kimi bridge<br/>[kimiBridge.ts]"]
  node_connect["OAuth card<br/>[KimiConnect.tsx]"]
  node_authclient["OAuth client<br/>[kimiAuth.ts]"]
end

node_operator(("Operator"))
node_localcli["Kimi CLI"]
node_authservice["Kimi auth service"]

node_operator -->|"uses"| node_app
node_app -->|"reads state"| node_store
node_app -->|"opens"| node_palette
node_app -->|"renders"| node_space
node_app -->|"renders"| node_work
node_app -->|"renders"| node_goals
node_app -->|"renders"| node_org
node_app -->|"renders"| node_agents
node_app -->|"renders"| node_skills
node_app -->|"renders"| node_approvals
node_app -->|"renders"| node_finance
node_app -->|"renders"| node_activity
node_app -->|"renders"| node_reports
node_app -->|"renders"| node_portfolio
node_palette -->|"dispatches actions"| node_store
node_work -->|"reads and dispatches"| node_store
node_space -->|"reads and dispatches"| node_store
node_agents -->|"reads and dispatches"| node_store
node_skills -->|"reads and dispatches"| node_store
node_approvals -->|"reads and dispatches"| node_store
node_store -->|"initializes from"| node_seed
node_store -->|"runs autopilot"| node_runtime
node_work -->|"runs agent"| node_runtime
node_space -->|"runs agent"| node_runtime
node_store -->|"loads and saves snapshots"| node_stateapi
node_stateapi -->|"reads and writes"| node_db
node_connect -->|"starts and polls"| node_authclient
node_authclient -.->|"requests OAuth"| node_authservice
node_space -.->|"sends local chat"| node_kimi
node_kimi -.->|"spawns"| node_localcli
node_kimi -.->|"stores sessions"| node_db
node_skillsreg -->|"provides skills"| node_work

click node_app "https://github.com/codejunkie99/meridian-company-os/blob/main/src/App.tsx"
click node_palette "https://github.com/codejunkie99/meridian-company-os/blob/main/src/components/CommandPalette.tsx"
click node_space "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Space.tsx"
click node_work "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Work.tsx"
click node_goals "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Goals.tsx"
click node_org "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Org.tsx"
click node_agents "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Agents.tsx"
click node_skills "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Skills.tsx"
click node_approvals "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Approvals.tsx"
click node_finance "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Finance.tsx"
click node_activity "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Activity.tsx"
click node_reports "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Reports.tsx"
click node_portfolio "https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Portfolio.tsx"
click node_store "https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/store.tsx"
click node_runtime "https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/runtime.ts"
click node_seed "https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/seed.ts"
click node_skillsreg "https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/skills.ts"
click node_stateapi "https://github.com/codejunkie99/meridian-company-os/blob/main/server/stateApi.ts"
click node_db "https://github.com/codejunkie99/meridian-company-os/blob/main/server/db.ts"
click node_kimi "https://github.com/codejunkie99/meridian-company-os/blob/main/server/kimiBridge.ts"
click node_connect "https://github.com/codejunkie99/meridian-company-os/blob/main/src/components/KimiConnect.tsx"
click node_authclient "https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/kimiAuth.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_app,node_palette toneBlue
class node_space,node_work,node_goals,node_org,node_agents,node_skills toneAmber
class node_approvals,node_finance,node_activity,node_reports,node_portfolio toneMint
class node_store,node_runtime,node_seed,node_skillsreg,node_stateapi,node_db toneRose
class node_kimi,node_connect,node_authclient,node_operator,node_localcli,node_authservice toneIndigo
```

## Components

### Operator console

- [App shell](https://github.com/codejunkie99/meridian-company-os/blob/main/src/App.tsx): `src/App.tsx`
- [Command palette](https://github.com/codejunkie99/meridian-company-os/blob/main/src/components/CommandPalette.tsx): `src/components/CommandPalette.tsx`

### Company operations

- [Kimi Space](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Space.tsx): `src/views/Space.tsx`
- [Work board](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Work.tsx): `src/views/Work.tsx`
- [Goals view](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Goals.tsx): `src/views/Goals.tsx`
- [Org chart](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Org.tsx): `src/views/Org.tsx`
- [Agent roster](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Agents.tsx): `src/views/Agents.tsx`
- [Skills view](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Skills.tsx): `src/views/Skills.tsx`

### Governance and insight

- [Approvals inbox](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Approvals.tsx): `src/views/Approvals.tsx`
- [Finance view](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Finance.tsx): `src/views/Finance.tsx`
- [Activity log](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Activity.tsx): `src/views/Activity.tsx`
- [CEO reports](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Reports.tsx): `src/views/Reports.tsx`
- [Company portfolio](https://github.com/codejunkie99/meridian-company-os/blob/main/src/views/Portfolio.tsx): `src/views/Portfolio.tsx`

### State and execution

- [Operating store](https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/store.tsx): `src/lib/store.tsx`
- [Agent runner](https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/runtime.ts): `src/lib/runtime.ts`
- [Seeded companies](https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/seed.ts): `src/lib/seed.ts`
- [Skill registry](https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/skills.ts): `src/lib/skills.ts`
- [Snapshot API](https://github.com/codejunkie99/meridian-company-os/blob/main/server/stateApi.ts): `server/stateApi.ts`
- [Local KV store](https://github.com/codejunkie99/meridian-company-os/blob/main/server/db.ts): `server/db.ts`

### Kimi integrations

- [Kimi bridge](https://github.com/codejunkie99/meridian-company-os/blob/main/server/kimiBridge.ts): `server/kimiBridge.ts`
- [OAuth card](https://github.com/codejunkie99/meridian-company-os/blob/main/src/components/KimiConnect.tsx): `src/components/KimiConnect.tsx`
- [OAuth client](https://github.com/codejunkie99/meridian-company-os/blob/main/src/lib/kimiAuth.ts): `src/lib/kimiAuth.ts`

### Other components

- **Operator**
- **Kimi CLI**
- **Kimi auth service**

## Connections

- Operator → App shell: uses
- App shell → Operating store: reads state
- App shell → Command palette: opens
- App shell → Kimi Space: renders
- App shell → Work board: renders
- App shell → Goals view: renders
- App shell → Org chart: renders
- App shell → Agent roster: renders
- App shell → Skills view: renders
- App shell → Approvals inbox: renders
- App shell → Finance view: renders
- App shell → Activity log: renders
- App shell → CEO reports: renders
- App shell → Company portfolio: renders
- Command palette → Operating store: dispatches actions
- Work board → Operating store: reads and dispatches
- Kimi Space → Operating store: reads and dispatches
- Agent roster → Operating store: reads and dispatches
- Skills view → Operating store: reads and dispatches
- Approvals inbox → Operating store: reads and dispatches
- Operating store → Seeded companies: initializes from
- Operating store → Agent runner: runs autopilot
- Work board → Agent runner: runs agent
- Kimi Space → Agent runner: runs agent
- Operating store → Snapshot API: loads and saves snapshots
- Snapshot API → Local KV store: reads and writes
- OAuth card → OAuth client: starts and polls
- OAuth client → Kimi auth service: requests OAuth
- Kimi Space → Kimi bridge: sends local chat
- Kimi bridge → Kimi CLI: spawns
- Kimi bridge → Local KV store: stores sessions
- Skill registry → Work board: provides skills
