Function: pickActivePersona()
pickActivePersona<
T>(personas,chatPersonaId,appPersonaId):T|null
Defined in: packages/contracts/src/persona.ts:37
The "active persona" rule as a pure function over an in-memory list
(ARCH-13): chat-level override → app-wide active persona → the persona
flagged default, falling through at each level on a stale reference. The
server applies the identical rule in PersonaRepository.resolveActive;
the web applies this one — both must stay word-for-word equivalent.
Type Parameters
T
T extends object
Parameters
personas
readonly T[]
chatPersonaId
string | null | undefined
appPersonaId
string | null | undefined
Returns
T | null