# mrazakhalid/starnet architecture

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

- Interactive diagram: https://gitdiagram.com/mrazakhalid/starnet
- Repository: https://github.com/mrazakhalid/starnet

## Overview

StarNet is a local-first desktop harness for creating AI-agent teams, arranging them in a capability-scoped station, and running real model- and tool-backed work. Users configure agents and providers, assign work through the station layout or recipes, then review results, files, costs, and run history. The README documents the frontend/sidecar boundary and major product capabilities; several feature implementations are unsampled, so their internal call paths are not inferred here.

Main entry points: [`sidecar/domain-task.js`](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/domain-task.js) (Agent runtime), [`frontend/app/app.js`](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/app.js) (Station UI), [`frontend/app/pipeline.js`](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/pipeline.js) (Routing plan), [`sidecar/channels`](https://github.com/mrazakhalid/starnet/tree/feat/harness-backend/sidecar/channels) (Messaging channels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_station["Station and workflow"]
  node_ui["Station UI<br/>[app.js]"]
  node_world["Station model<br/>[worldmodel.js]"]
  node_routing["Routing plan<br/>[pipeline.js]"]
  node_recipe["Recipes and skills"]
  node_scheduler["Schedules<br/>[autojobs.js]"]
  node_taskbrief["Task briefs"]
end

subgraph group_runtime["Agent runtime"]
  node_runtime["Agent runtime<br/>[domain-task.js]"]
  node_orchestration["Team dispatch<br/>[orchestration.js]"]
  node_capability["Capability checks<br/>[registry.js]"]
end

subgraph group_integrations["Providers and connectors"]
  node_provider["Model providers<br/>[provider.js]"]
  node_openrouter["OpenRouter adapter<br/>[openrouter.js]"]
  node_mcp["MCP connectors<br/>[manager.js]"]
  node_channels["Messaging channels"]
  node_voice["Voice services<br/>[media-service.js]"]
end

subgraph group_persistence["State and review"]
  node_outbox["Deliverables outbox<br/>[deliverables.js]"]
  node_ledgers[("Spend and run ledgers<br/>[recledger.js]")]
  node_memory[("Agent memory<br/>[threadstore.js]")]
  node_stationstore[("Station state<br/>[station-store.js]")]
end

subgraph group_desktop["Desktop shell"]
  node_desktop["Desktop shell<br/>[main.rs]"]
end

node_user(("User"))
node_models{{"Model services"}}
node_externalchannels{{"Messaging services"}}

node_user -->|"configures and starts"| node_ui
node_ui -.->|"edits station"| node_world
node_world -->|"compiles layout"| node_routing
node_ui -->|"submits plan"| node_routing
node_ui -->|"sends station state"| node_stationstore
node_routing -.->|"routes work"| node_runtime
node_recipe -.->|"launches work"| node_runtime
node_scheduler -.->|"schedules runs"| node_runtime
node_taskbrief -.->|"asks for clarification"| node_channels
node_runtime -.->|"requests model calls"| node_provider
node_openrouter -->|"streams requests"| node_models
node_provider -.->|"calls models"| node_models
node_runtime -->|"checks permissions"| node_capability
node_runtime -->|"dispatches workers"| node_orchestration
node_mcp -->|"provides tools"| node_runtime
node_runtime -.->|"connects agent messaging"| node_channels
node_channels -.->|"sends and receives messages"| node_externalchannels
node_runtime -.->|"uses voice services"| node_voice
node_runtime -.->|"publishes deliverables"| node_outbox
node_runtime -.->|"records spend and runs"| node_ledgers
node_runtime -.->|"persists agent memory"| node_memory
node_desktop -->|"opens station"| node_ui
node_desktop -.->|"provides desktop window"| node_user

click node_ui "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/app.js"
click node_world "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/worldmodel.js"
click node_routing "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/pipeline.js"
click node_recipe "https://github.com/mrazakhalid/starnet/tree/feat/harness-backend/frontend/app/recipe-catalog"
click node_scheduler "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/autojobs.js"
click node_taskbrief "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/taskconversation.js"
click node_runtime "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/domain-task.js"
click node_orchestration "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/tools/builtin/orchestration.js"
click node_capability "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/capability/registry.js"
click node_provider "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/providers/provider.js"
click node_openrouter "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/providers/openrouter.js"
click node_mcp "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/mcp/manager.js"
click node_channels "https://github.com/mrazakhalid/starnet/tree/feat/harness-backend/sidecar/channels"
click node_voice "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/media-service.js"
click node_outbox "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/deliverables.js"
click node_ledgers "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/recledger.js"
click node_memory "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/threadstore.js"
click node_stationstore "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/station-store.js"
click node_desktop "https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/src-tauri/src/main.rs"

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_ui,node_world,node_routing,node_recipe,node_scheduler,node_taskbrief,node_user toneBlue
class node_runtime,node_orchestration,node_capability toneAmber
class node_provider,node_openrouter,node_mcp,node_channels,node_voice toneMint
class node_outbox,node_ledgers,node_memory,node_stationstore toneRose
class node_desktop,node_models,node_externalchannels toneIndigo
```

## Components

### Station and workflow

- [Station UI](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/app.js): `frontend/app/app.js`
- [Station model](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/worldmodel.js): `frontend/app/worldmodel.js`
- [Routing plan](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/pipeline.js): `frontend/app/pipeline.js`
- [Recipes and skills](https://github.com/mrazakhalid/starnet/tree/feat/harness-backend/frontend/app/recipe-catalog): `frontend/app/recipe-catalog`
- [Schedules](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/autojobs.js): `frontend/app/autojobs.js`
- [Task briefs](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/taskconversation.js): `frontend/app/taskconversation.js`

### Agent runtime

- [Agent runtime](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/domain-task.js): `sidecar/domain-task.js`
- [Team dispatch](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/tools/builtin/orchestration.js): `sidecar/tools/builtin/orchestration.js`
- [Capability checks](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/capability/registry.js): `sidecar/capability/registry.js`

### Providers and connectors

- [Model providers](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/providers/provider.js): `sidecar/providers/provider.js`
- [OpenRouter adapter](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/providers/openrouter.js): `sidecar/providers/openrouter.js`
- [MCP connectors](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/mcp/manager.js): `sidecar/mcp/manager.js`
- [Messaging channels](https://github.com/mrazakhalid/starnet/tree/feat/harness-backend/sidecar/channels): `sidecar/channels`
- [Voice services](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/media-service.js): `sidecar/media-service.js`

### State and review

- [Deliverables outbox](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/deliverables.js): `frontend/app/deliverables.js`
- [Spend and run ledgers](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/recledger.js): `frontend/app/recledger.js`
- [Agent memory](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/frontend/app/threadstore.js): `frontend/app/threadstore.js`
- [Station state](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/sidecar/station-store.js): `sidecar/station-store.js`

### Desktop shell

- [Desktop shell](https://github.com/mrazakhalid/starnet/blob/feat/harness-backend/src-tauri/src/main.rs): `src-tauri/src/main.rs`

### Other components

- **User**
- **Model services**
- **Messaging services**

## Connections

- User → Station UI: configures and starts (evidence: `README.md`)
- Station UI → Station model: edits station
- Station model → Routing plan: compiles layout (evidence: `frontend/app/pipeline.js`)
- Station UI → Routing plan: submits plan
- Station UI → Station state: sends station state (evidence: `sidecar/station-store.js`)
- Routing plan → Agent runtime: routes work
- Recipes and skills → Agent runtime: launches work (evidence: `README.md`)
- Schedules → Agent runtime: schedules runs (evidence: `README.md`)
- Task briefs → Messaging channels: asks for clarification (evidence: `README.md`)
- Agent runtime → Model providers: requests model calls (evidence: `README.md`)
- OpenRouter adapter → Model services: streams requests (evidence: `sidecar/providers/openrouter.js`)
- Model providers → Model services: calls models (evidence: `README.md`)
- Agent runtime → Capability checks: checks permissions (evidence: `README.md`)
- Agent runtime → Team dispatch: dispatches workers (evidence: `sidecar/tools/builtin/orchestration.js`)
- MCP connectors → Agent runtime: provides tools
- Agent runtime → Messaging channels: connects agent messaging (evidence: `README.md`)
- Messaging channels → Messaging services: sends and receives messages (evidence: `README.md`)
- Agent runtime → Voice services: uses voice services (evidence: `README.md`)
- Agent runtime → Deliverables outbox: publishes deliverables (evidence: `README.md`)
- Agent runtime → Spend and run ledgers: records spend and runs (evidence: `README.md`)
- Agent runtime → Agent memory: persists agent memory (evidence: `README.md`)
- Desktop shell → Station UI: opens station (evidence: `src-tauri/src/main.rs`)
- Desktop shell → User: provides desktop window (evidence: `README.md`)
