Skip to main content

Function: clonePersonaDefinition()

clonePersonaDefinition(definition): IPersonaDefinition

Defined in: packages/agentos/src/cognition/substrate/personas/personaNormalization.ts:129

Returns a copy of a definition that shares nothing with the input (a replaced metaPrompts mark included): structuredClone for the plain data every JSON persona is made of, and a shallow copy for a code-built definition that carries values structuredClone rejects (functions, class instances), whose nested objects then stay shared with the caller.

Parameters​

definition​

IPersonaDefinition

Returns​

IPersonaDefinition