# mrhoosier23/starnet architecture

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

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

## Overview

StarNet is a local-first desktop harness for creating bounded AI agents, arranging them into capability-scoped station teams, and running real model-and-tool work. The principal flow is station setup and routing, agent execution, then persistent records and a live station view; connected channels, scheduled work, deliverables, connectors, voice, and remote access extend it. The README and excerpts support the product boundaries and selected routing, provider, connector, and shell relationships; several subsystem links are documented capabilities rather than inspected call paths.

Main entry points: [`sidecar/context.js`](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/context.js) (Agent Context), [`frontend/app/app.js`](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/app.js) (Station UI), [`frontend/app/pipeline.js`](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/pipeline.js) (Routing Plan), [`frontend/app/worldmodel.js`](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/worldmodel.js) (Station Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_station["Station &amp; Routing"]
  node_station_ui["Station UI<br/>[app.js]"]
  node_station_model["Station Model<br/>[worldmodel.js]"]
  node_routing_plan["Routing Plan<br/>[pipeline.js]"]
  node_router["Work Router<br/>[router.js]"]
end

subgraph group_runs["Agent Runs"]
  node_agent_context["Agent Context<br/>[context.js]"]
  node_model_provider["Model Providers<br/>[provider.js]"]
  node_capabilities["Capabilities &amp; Tools<br/>[registry.js]"]
  node_night_shift["Night Shift"]
  node_recipes_schedules["Recipes &amp; Schedules"]
  node_apps["Agent Apps<br/>[apps.js]"]
end

subgraph group_integrations["Connections"]
  node_openrouter["OpenRouter<br/>[openrouter.js]"]
  node_mcp_manager["MCP Connectors<br/>[manager.js]"]
  node_mcp_translate["MCP Tool Translator<br/>[translate.js]"]
  node_channels["Messaging Channels"]
  node_remote["Remote Access<br/>[relay-client.js]"]
  node_voice["Voice<br/>[voice.js]"]
end

subgraph group_state["State &amp; Output"]
  node_persistence[("Local Persistence<br/>[index.js]")]
  node_ledgers[("Spend &amp; Run Ledgers")]
  node_deliverables["Deliverables Outbox<br/>[deliverables.js]"]
  node_station_view["Live Station View<br/>[worldrenderer.js]"]
end

subgraph group_desktop["Desktop Shell"]
  node_desktop_shell["Tauri Shell<br/>[main.rs]"]
  node_desktop_lifecycle["Desktop Lifecycle"]
end

node_commander(("Commander"))

node_commander -->|"configures"| node_station_ui
node_station_ui -.->|"defines layout"| node_routing_plan
node_station_model -->|"projects geometry"| node_routing_plan
node_router -->|"compiles with"| node_routing_plan
node_router -.->|"dispatches work"| node_agent_context
node_agent_context -.->|"requests model work"| node_model_provider
node_model_provider -->|"supports provider"| node_openrouter
node_agent_context -.->|"uses tools"| node_capabilities
node_capabilities -.->|"offers connectors"| node_mcp_manager
node_mcp_manager -->|"translates tools"| node_mcp_translate
node_commander -->|"messages remotely"| node_channels
node_commander -->|"connects remotely"| node_remote
node_commander -->|"arms unattended work"| node_night_shift
node_commander -->|"launches scheduled work"| node_recipes_schedules
node_commander -->|"speaks to station"| node_voice
node_agent_context -->|"builds apps"| node_apps
node_agent_context -->|"persists state"| node_persistence
node_persistence -.->|"stores records"| node_ledgers
node_agent_context -->|"produces files"| node_deliverables
node_station_model -->|"projects live state"| node_station_view
node_desktop_shell -->|"manages lifecycle"| node_desktop_lifecycle
node_desktop_shell -->|"opens web app"| node_station_ui

click node_station_ui "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/app.js"
click node_station_model "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/worldmodel.js"
click node_routing_plan "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/pipeline.js"
click node_router "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/routing/router.js"
click node_agent_context "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/context.js"
click node_model_provider "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/providers/provider.js"
click node_openrouter "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/providers/openrouter.js"
click node_capabilities "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/capability/registry.js"
click node_mcp_manager "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/mcp/manager.js"
click node_mcp_translate "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/mcp/translate.js"
click node_channels "https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/sidecar/channels"
click node_remote "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/remote/relay-client.js"
click node_night_shift "https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/sidecar"
click node_recipes_schedules "https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/frontend/app"
click node_voice "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/voice.js"
click node_apps "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/tools/builtin/apps.js"
click node_persistence "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/persist/index.js"
click node_ledgers "https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/frontend/app"
click node_deliverables "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/deliverables.js"
click node_station_view "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/worldrenderer.js"
click node_desktop_shell "https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/src-tauri/src/main.rs"
click node_desktop_lifecycle "https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/src-tauri/src"

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_station_ui,node_station_model,node_routing_plan,node_router toneBlue
class node_agent_context,node_model_provider,node_capabilities,node_night_shift,node_recipes_schedules,node_apps toneAmber
class node_openrouter,node_mcp_manager,node_mcp_translate,node_channels,node_remote,node_voice toneMint
class node_persistence,node_ledgers,node_deliverables,node_station_view toneRose
class node_desktop_shell,node_desktop_lifecycle,node_commander toneIndigo
```

## Components

### Station & Routing

- [Station UI](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/app.js): `frontend/app/app.js`
- [Station Model](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/worldmodel.js): `frontend/app/worldmodel.js`
- [Routing Plan](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/pipeline.js): `frontend/app/pipeline.js`
- [Work Router](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/routing/router.js): `sidecar/routing/router.js`

### Agent Runs

- [Agent Context](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/context.js): `sidecar/context.js`
- [Model Providers](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/providers/provider.js): `sidecar/providers/provider.js`
- [Capabilities & Tools](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/capability/registry.js): `sidecar/capability/registry.js`
- [Night Shift](https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/sidecar): `sidecar`
- [Recipes & Schedules](https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/frontend/app): `frontend/app`
- [Agent Apps](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/tools/builtin/apps.js): `sidecar/tools/builtin/apps.js`

### Connections

- [OpenRouter](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/providers/openrouter.js): `sidecar/providers/openrouter.js`
- [MCP Connectors](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/mcp/manager.js): `sidecar/mcp/manager.js`
- [MCP Tool Translator](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/mcp/translate.js): `sidecar/mcp/translate.js`
- [Messaging Channels](https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/sidecar/channels): `sidecar/channels`
- [Remote Access](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/remote/relay-client.js): `sidecar/remote/relay-client.js`
- [Voice](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/voice.js): `frontend/app/voice.js`

### State & Output

- [Local Persistence](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/sidecar/persist/index.js): `sidecar/persist/index.js`
- [Spend & Run Ledgers](https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/frontend/app): `frontend/app`
- [Deliverables Outbox](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/deliverables.js): `frontend/app/deliverables.js`
- [Live Station View](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/frontend/app/worldrenderer.js): `frontend/app/worldrenderer.js`

### Desktop Shell

- [Tauri Shell](https://github.com/mrhoosier23/starnet/blob/feat/harness-backend/src-tauri/src/main.rs): `src-tauri/src/main.rs`
- [Desktop Lifecycle](https://github.com/mrhoosier23/starnet/tree/feat/harness-backend/src-tauri/src): `src-tauri/src`

### Other components

- **Commander**

## Connections

- Commander → Station UI: configures (evidence: `README.md`)
- Station UI → Routing Plan: defines layout
- Station Model → Routing Plan: projects geometry (evidence: `frontend/app/pipeline.js`)
- Work Router → Routing Plan: compiles with (evidence: `sidecar/routing/router.js`)
- Work Router → Agent Context: dispatches work
- Agent Context → Model Providers: requests model work
- Model Providers → OpenRouter: supports provider (evidence: `sidecar/providers/openrouter.js`)
- Agent Context → Capabilities & Tools: uses tools
- Capabilities & Tools → MCP Connectors: offers connectors
- MCP Connectors → MCP Tool Translator: translates tools (evidence: `sidecar/mcp/manager.js`)
- Commander → Messaging Channels: messages remotely (evidence: `README.md`)
- Commander → Remote Access: connects remotely (evidence: `README.md`)
- Commander → Night Shift: arms unattended work (evidence: `README.md`)
- Commander → Recipes & Schedules: launches scheduled work (evidence: `README.md`)
- Commander → Voice: speaks to station (evidence: `README.md`)
- Agent Context → Agent Apps: builds apps (evidence: `sidecar/tools/builtin/apps.js`)
- Agent Context → Local Persistence: persists state (evidence: `README.md`)
- Local Persistence → Spend & Run Ledgers: stores records
- Agent Context → Deliverables Outbox: produces files (evidence: `README.md`)
- Station Model → Live Station View: projects live state (evidence: `README.md`)
- Tauri Shell → Desktop Lifecycle: manages lifecycle (evidence: `src-tauri/src/main.rs`)
- Tauri Shell → Station UI: opens web app (evidence: `src-tauri/src/main.rs`)
