# EntitySelector

**Kind:** Class

**Source:** [`atloria-monorepo/packages/doc-automation/src/v2/stages/stage-10-generation/entity-selector.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/doc-automation/src/v2/stages/stage-10-generation/entity-selector.ts#L45)

EntitySelector - Smart entity selection for document generation

Selects entities based on:
1. Tier priority (TIER_1 > TIER_2 > TIER_3)
2. User-facing status
3. Document plan requirements
4. Token budget constraints

## Methods

| Method | Signature | Returns |
|---|---|---|
| `selectForDocument` | `selectForDocument(plan: DocumentPlan, entities: Entity[])` | `Entity[]` |
| `selectRelated` | `selectRelated(entityId: string, entities: Entity[])` | `Entity[]` |
| `selectByType` | `selectByType(entities: Entity[], types: Entity['type'][])` | `Entity[]` |
| `selectUserFacing` | `selectUserFacing(entities: Entity[])` | `Entity[]` |
| `selectByFeatureArea` | `selectByFeatureArea(entities: Entity[], featureArea: string)` | `Entity[]` |

## Where it refuses work

- `EntitySelector` stops the work with an early return when `!target`.
