# Feature Manager

The Feature Manager coordinates feature lifecycle, execution, and ordering.

Each addon owns one (or more feature managers in future) responsible for managing its features.

***

### Overview

A `FeatureManager` is responsible for:

* registering features
* freezing the feature set after initialization
* ordering features by priority
* dispatching lifecycle events
* controlling feature ticking
* exposing diagnostic information

***

### Core Types

#### FeatureManager

`FeatureManager` manages a collection of features belonging to a single addon.

{% @github-files/github-code-block url="<https://github.com/c0nnor263/OperateMyServer/blob/main/oms-api/src/main/kotlin/io/conboi/oms/api/foundation/manager/FeatureManager.kt>" %}

***

#### FeatureManagerInfo

`FeatureManagerInfo` provides a snapshot of the manager and its features for diagnostics.

{% @github-files/github-code-block url="<https://github.com/c0nnor263/OperateMyServer/blob/main/oms-api/src/main/kotlin/io/conboi/oms/api/foundation/manager/FeatureManagerInfo.kt>" %}

***

### Lifecycle

1. Features are registered before startup
2. Manager is frozen
3. Features are ordered by priority
4. Lifecycle events are dispatched
5. Features are ticked according to the manager’s timer
6. On shutdown, features receive stopping events

***

### Behavior

* Only registered features are executed
* Feature registration is not allowed after freeze
* Features are executed in priority order
* Only enabled features receive ticking events
* Tick frequency is controlled internally

***

### Notes

* Each addon owns at least one `FeatureManager`
* The manager is the central execution layer of OMS
* All feature logic is executed through it
* Event dispatching is handled by the manager


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://conboi.gitbook.io/oms-wiki/developer-guide/core-architecture/feature-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
