# couillos/lifescape architecture

> Architecture diagram of the GitHub repository couillos/lifescape, 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/couillos/lifescape
- Repository: https://github.com/couillos/lifescape

## Overview

LifeScape is a Rust botting framework for LostCityRS. A user invokes the orchestrator CLI to open an account and run a registered script; the orchestrator manages its session worker, which uses the SDK to communicate with the game and navigation service. The planner and game data support bot decisions, while the daemon also provides a live dashboard and market services. Edges reflect README statements and the supplied source excerpts/index; unsampled implementation details are not asserted.

Main entry points: [`rs/crates/orchestrator/src/worker_owner.rs`](https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/worker_owner.rs) (Session Worker), [`rs/crates/planner/src/ambition.rs`](https://github.com/couillos/lifescape/blob/main/rs/crates/planner/src/ambition.rs) (Bot Planner), [`rs/crates/orchestrator/src/daemon.rs`](https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/daemon.rs) (Session Daemon), [`rs/crates/nav/src/plan.rs`](https://github.com/couillos/lifescape/blob/main/rs/crates/nav/src/plan.rs) (Route Planner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot Runtime"]
  node_cli["Orchestrator CLI<br/>[main.rs]"]
  node_daemon["Session Daemon<br/>[daemon.rs]"]
  node_worker["Session Worker<br/>[worker_owner.rs]"]
  node_scripts["Script Registry"]
  node_sdk["Game SDK"]
end

subgraph group_planning["Planning and Data"]
  node_planner["Bot Planner<br/>[ambition.rs]"]
  node_guide_engine["Guide Engine<br/>[guide_engine.rs]"]
  node_planner_model["Planner Model<br/>[model.rs]"]
  node_gamedata["Game Data"]
end

subgraph group_navigation["Navigation"]
  node_nav_service["Navigation Service<br/>[service.rs]"]
  node_nav_plan["Route Planner<br/>[plan.rs]"]
  node_nav_world["Static World<br/>[static_world.rs]"]
  node_nav_tables["Navigation Tables<br/>[tables.rs]"]
end

subgraph group_market["Market Services"]
  node_market_service["Market Service<br/>[market_service.rs]"]
  node_market_core["Market Engine"]
  node_store[("Market Store")]
end

subgraph group_dashboard["Dashboard"]
  node_web["Dashboard HTTP/WS<br/>[web.rs]"]
end

node_user(("Operator"))
node_browser(("Dashboard User"))

node_user -->|"runs commands"| node_cli
node_cli -->|"manages sessions"| node_daemon
node_daemon -->|"manages workers"| node_worker
node_worker -.->|"runs script"| node_scripts
node_worker -->|"uses game client"| node_sdk
node_planner -->|"uses model"| node_planner_model
node_planner -.->|"uses guide pricing"| node_guide_engine
node_worker -.->|"requests decisions"| node_planner
node_planner -.->|"uses game data"| node_gamedata
node_sdk -.->|"requests routes"| node_nav_service
node_nav_service -->|"runs plans"| node_nav_plan
node_nav_plan -->|"reads collision"| node_nav_world
node_nav_plan -->|"reads transitions"| node_nav_tables
node_daemon -->|"hosts market"| node_market_service
node_market_service -.->|"uses engine"| node_market_core
node_market_service -->|"persists market data"| node_store
node_browser -->|"views dashboard"| node_web

click node_cli "https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/main.rs"
click node_daemon "https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/daemon.rs"
click node_worker "https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/worker_owner.rs"
click node_scripts "https://github.com/couillos/lifescape/tree/main/rs/crates/scripts"
click node_sdk "https://github.com/couillos/lifescape/tree/main/rs/crates/sdk/src"
click node_planner "https://github.com/couillos/lifescape/blob/main/rs/crates/planner/src/ambition.rs"
click node_guide_engine "https://github.com/couillos/lifescape/blob/main/rs/crates/planner/src/guide_engine.rs"
click node_planner_model "https://github.com/couillos/lifescape/blob/main/rs/crates/planner/src/model.rs"
click node_gamedata "https://github.com/couillos/lifescape/tree/main/rs/crates/gamedata/src"
click node_nav_service "https://github.com/couillos/lifescape/blob/main/rs/crates/nav/src/service.rs"
click node_nav_plan "https://github.com/couillos/lifescape/blob/main/rs/crates/nav/src/plan.rs"
click node_nav_world "https://github.com/couillos/lifescape/blob/main/rs/crates/nav/src/static_world.rs"
click node_nav_tables "https://github.com/couillos/lifescape/blob/main/rs/crates/nav/src/tables.rs"
click node_market_service "https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/market_service.rs"
click node_market_core "https://github.com/couillos/lifescape/tree/main/rs/crates/market/src"
click node_store "https://github.com/couillos/lifescape/tree/main/rs/crates/store/src"
click node_web "https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/web.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_cli,node_daemon,node_worker,node_scripts,node_sdk,node_browser toneBlue
class node_planner,node_guide_engine,node_planner_model,node_gamedata toneAmber
class node_nav_service,node_nav_plan,node_nav_world,node_nav_tables toneMint
class node_market_service,node_market_core,node_store toneRose
class node_web,node_user toneIndigo
```

## Components

### Bot Runtime

- [Orchestrator CLI](https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/main.rs): `rs/crates/orchestrator/src/main.rs`
- [Session Daemon](https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/daemon.rs): `rs/crates/orchestrator/src/daemon.rs`
- [Session Worker](https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/worker_owner.rs): `rs/crates/orchestrator/src/worker_owner.rs`
- [Script Registry](https://github.com/couillos/lifescape/tree/main/rs/crates/scripts): `rs/crates/scripts`
- [Game SDK](https://github.com/couillos/lifescape/tree/main/rs/crates/sdk/src): `rs/crates/sdk/src`

### Planning and Data

- [Bot Planner](https://github.com/couillos/lifescape/blob/main/rs/crates/planner/src/ambition.rs): `rs/crates/planner/src/ambition.rs`
- [Guide Engine](https://github.com/couillos/lifescape/blob/main/rs/crates/planner/src/guide_engine.rs): `rs/crates/planner/src/guide_engine.rs`
- [Planner Model](https://github.com/couillos/lifescape/blob/main/rs/crates/planner/src/model.rs): `rs/crates/planner/src/model.rs`
- [Game Data](https://github.com/couillos/lifescape/tree/main/rs/crates/gamedata/src): `rs/crates/gamedata/src`

### Navigation

- [Navigation Service](https://github.com/couillos/lifescape/blob/main/rs/crates/nav/src/service.rs): `rs/crates/nav/src/service.rs`
- [Route Planner](https://github.com/couillos/lifescape/blob/main/rs/crates/nav/src/plan.rs): `rs/crates/nav/src/plan.rs`
- [Static World](https://github.com/couillos/lifescape/blob/main/rs/crates/nav/src/static_world.rs): `rs/crates/nav/src/static_world.rs`
- [Navigation Tables](https://github.com/couillos/lifescape/blob/main/rs/crates/nav/src/tables.rs): `rs/crates/nav/src/tables.rs`

### Market Services

- [Market Service](https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/market_service.rs): `rs/crates/orchestrator/src/market_service.rs`
- [Market Engine](https://github.com/couillos/lifescape/tree/main/rs/crates/market/src): `rs/crates/market/src`
- [Market Store](https://github.com/couillos/lifescape/tree/main/rs/crates/store/src): `rs/crates/store/src`

### Dashboard

- [Dashboard HTTP/WS](https://github.com/couillos/lifescape/blob/main/rs/crates/orchestrator/src/web.rs): `rs/crates/orchestrator/src/web.rs`

### Other components

- **Operator**
- **Dashboard User**

## Connections

- Operator → Orchestrator CLI: runs commands
- Orchestrator CLI → Session Daemon: manages sessions
- Session Daemon → Session Worker: manages workers
- Session Worker → Script Registry: runs script
- Session Worker → Game SDK: uses game client
- Bot Planner → Planner Model: uses model (evidence: `rs/crates/planner/src/ambition.rs`)
- Bot Planner → Guide Engine: uses guide pricing
- Session Worker → Bot Planner: requests decisions
- Bot Planner → Game Data: uses game data
- Game SDK → Navigation Service: requests routes
- Navigation Service → Route Planner: runs plans (evidence: `rs/crates/nav/src/service.rs`)
- Route Planner → Static World: reads collision (evidence: `rs/crates/nav/src/plan.rs`)
- Route Planner → Navigation Tables: reads transitions (evidence: `rs/crates/nav/src/plan.rs`)
- Session Daemon → Market Service: hosts market (evidence: `rs/crates/orchestrator/src/market_service.rs`)
- Market Service → Market Engine: uses engine
- Market Service → Market Store: persists market data (evidence: `rs/crates/orchestrator/src/market_service.rs`)
- Dashboard User → Dashboard HTTP/WS: views dashboard
