Emotions
Emotions are organized in a two-level hierarchy: Category → Emotion. They are used to tag dialog scene blocks, enabling the emotional arc analysis feature on scenes.
Data models
EmotionCategory
| Field | Type | Description |
|---|---|---|
id | number | Primary key |
name | string | Category label (e.g. "Negative", "Positive") |
description | string | Optional explanation |
Emotion
| Field | Type | Description |
|---|---|---|
id | number | Primary key |
categoryId | number | Parent category |
name | string | Emotion label (e.g. "Melancholy") |
color | string | Hex color for visualization |
Emotional arc analysis
POST /scenes/:id/analyze-emotional-arc calls the LLM service with the scene's dialog blocks (each tagged with an emotion ID) and returns a timeline of emotional shifts. The result is displayed as a chart in the Scene Studio panel.
Requires SCENE_EMOTIONAL_ARC_GENERATE.
Frontend
The emotion picker (EmotionSelect) loads from GET /emotions/categories/with-emotions. The selection is stored on the scene_block.emotionId field and is visible in the block editor.
Permission scopes
| Scope | What it guards |
|---|---|
EMOTION_CREATE | Creating an emotion |
EMOTION_EDIT | Editing name / color |
EMOTION_DELETE | Deleting an emotion |
EMOTION_CATEGORY_CREATE | Creating a category |
EMOTION_CATEGORY_EDIT | Editing a category |
EMOTION_CATEGORY_DELETE | Deleting a category |
SCENE_EMOTIONAL_ARC_GENERATE | Running arc analysis |