# Shared Kernel

Types and constants that are **intentionally shared** across multiple bounded
contexts (domains). Changing anything here affects every consumer, so changes
require coordination.

## Files

| File | Contents |
|---|---|
| `user.models.ts` | `User`, `UserStatus`, `UserRole`, `RoomMember` |
| `room.models.ts` | `Room`, `RoomSettings`, `RoomPermissions`, `Channel`, `ChannelType` |
| `message.models.ts` | `Message`, `Reaction`, `DELETED_MESSAGE_CONTENT` |
| `moderation.models.ts` | `BanEntry` |
| `voice-state.models.ts` | `VoiceState`, `ScreenShareState` |
| `game-activity.models.ts` | `GameActivity`, `MatchedGame`, game-match API response contract |
| `chat-events.ts` | `ChatEventType`, `ChatEvent`, `ChatInventoryItem` |
| `direct-message-contracts.ts` | `DirectMessage`, delivery status, P2P DM event payloads |
| `media-preferences.ts` | `LatencyProfile`, `ScreenShareQuality`, quality presets |
| `signaling-contracts.ts` | `SignalingMessage`, `SignalingMessageType` |
| `attachment-contracts.ts` | `ChatAttachmentAnnouncement`, `ChatAttachmentMeta` |

## When to add here vs. in a domain

Add to shared-kernel when a type is referenced by **two or more domains** or by
**infrastructure + store**. If a type is only used inside one domain, keep it
in that domain's `domain/` folder.

## Backward compatibility

`core/models/index.ts` re-exports everything from this folder so existing
`import { X } from 'core/models'` lines keep working. **New code** should
import directly from `shared-kernel/` for clarity.
