---
url: /en/azurpilot.md
description: >-
  Architecture, WebUI layout, task categories, and execution model of the core
  engine hosted by desktop and Android.
---

# Core Program Overview

The core program ([wess09/AzurPilot](https://github.com/wess09/AzurPilot), default branch `master`) is the sole repository implementing game automation logic. The desktop launcher and Android host serve exclusively as execution environments.

## &#x20;Core Subsystems

| Subsystem | Key Directories | Responsibilities |
| --- | --- | --- |
| Entry Points | `alas.py`, `gui.py`, `mcp_server_sse.py`, `tui.py` | Scheduler loop, WebUI server, MCP service, terminal interface |
| Runtime | `module/api/`, `module/runtime/` | WebSocket routing, process supervision, updates, remote access, account vault |
| Business | `module/<feature>/`, `campaign/` | Feature modules implementing `run()` and campaign map graphs |
| Foundation | `module/device/`, `ui/`, `ocr/`, `map/`, `combat/` | Screenshots, input injection, UI navigation, OCR, pathfinding, battle logic |
| Data | `config/`, SQLite database, `assets/` | User configs, statistics, persistent states, 4-server recognition assets |

## &#x20;Three-Tier Execution Model

1. &#x20;**`gui.py` acts as the parent process**. It serves HTTP/WebSocket endpoints and static web assets without interacting with games directly.
2. &#x20;**Each instance runs in an isolated worker process**. Spawned by `ProcessManager` via `multiprocessing.Process`, running `AzurLaneAutoScript.loop()`.
3. &#x20;**Tasks execute sequentially on the worker's main thread**. Watchdogs and reporting routines run on secondary threads without executing concurrent game actions.

This architectural model explains several common behaviors:

* &#x20;Stopping an instance terminates the worker process tree while leaving the WebUI server running.
* &#x20;A single instance cannot execute two tasks concurrently; parallel execution requires multiple instances paired with multiple emulators.
* &#x20;Closing `gui.py` shuts down active workers, as workers are supervised children of the backend process.

## &#x20;WebUI Structure

| Section | Route | Content |
| --- | --- | --- |
| Home | `/` | Instance cards, start/stop switches, announcements |
| Instance Overview | `/i/<instance>/overview` | Active task, resource gauges, real-time logs, quick actions |
| Task Configuration | `/i/<instance>/task/<task>` | Forms dynamically rendered from `task.yaml` |
| Statistics | `/i/<instance>/statistics` | Reports for resources, sorties, Operation Siren, commissions, and inventory |
| Scheduler Program | `/i/<instance>/task/SchedulerProgram` | Visual graph-based scheduling orchestration |
| Mind Calculator | `/i/<instance>/task/MindCalculator` | Dock scanning and Cognitive Array cost calculator |
| Fleet Technology | `/i/<instance>/task/FleetTechnology` | Tech point scanning and fleet statistics |
| System Settings | `/settings` | Account vault, remote access, updates, theme settings |
| Configurations | `/configs` | Import, export, duplicate, and delete instances |

For detailed view breakdowns, read the [WebUI Tour](/en/azurpilot/user/webui).

## &#x20;Task Categories

The task navigation menu derives from `module/config/argument/task.yaml`, organized into 12 top-level groups:

| Group | Category | Representative Tasks |
| --- | --- | --- |
| `Alas` | System | Emulator setup, error handling, backup, daily summary |
| `Farm` | Sortie | Campaign maps 1/2/3, urgent commissions, 3-oil low-cost farming |
| `Event` | Events | Event stages 1/2/3, raid battles, War Archives |
| `EventDaily` | Event Dailies | Daily A/B/C/D/SP event clears |
| `Reward` | Automated Claims | Commissions, research, dorm, Meowfficer, guild logistics |
| `DailyMission` | Dailies | Daily challenges, limit challenges, hard mode, exercises |
| `Opsi` | Operation Siren | Exploration, obscure sectors, abyssal zones, strongholds, intelligent scheduler |
| `Island` | Cruise & Island Missions | Farmland, ranching, restaurants, manufacturing, daily gathering |
| `FleetManagement` | Fleet Management | Fleet scanning and fleet composition inspector |
| `RunParams` | Execution Parameters | Timing delays and device timeout thresholds |
| `Tool` | Utilities | Semi-automation, performance benchmarks, OCR tests, uncensor tools |
| `Dashboard` | Dashboard | Resource caps and gauge thresholds |

Review the [Task Command Matrix](/en/reference/tasks) for the full 102 task command catalog.

::: tip Dynamic Task Counts
Event releases dynamically add and remove tasks, altering method counts on `alas.py`. Documentation counts reflect current baseline versions.
:::

## &#x20;Extending Capabilities

Authoring a new task requires **matching identifiers in three locations plus one `run()` method**:

1. &#x20;Register the task command and group inside `task.yaml`.
2. &#x20;Define the corresponding method on `alas.py` (converting CamelCase to snake_case).
3. &#x20;Create a module under `module/<feature>/` providing a `run()` entry point.
4. &#x20;Execute `uv run -m module.config.config_updater` to regenerate configuration schemas.

Read [Adding a New Task](/en/azurpilot/developer/module-dev) for full development tutorials.

## &#x20;Continue Reading
