Skip to main content

Module persona

Module persona 

Source
Expand description

Personas for the standing chat: a voice, never a behaviour.

A persona is a short style instruction appended to crate::talk::briefing as a clearly delimited section. It governs tone only: facts, commands, task ids, duplicate-warning handling and the write policy stay exactly as the briefing states them. The persona text is never copied into an instruction handed to magi task add; implementers stay neutral.

The catalogue is the built-ins below plus [[talk.personas]] from the config. A user entry with a built-in’s id replaces it in place; a new id is appended. default is the plain voice, cannot be redefined, and is what a conversation uses until the operator picks something else.

Structs§

Persona
One entry of the catalogue.

Constants§

DEFAULT_ID
The id of the plain voice: no persona section at all.

Functions§

active
The persona to apply for a stored id: None for the default, and for an id the config no longer knows (a warning, never a stopped conversation).
addressing
The sentence naming the operator, shared by the persona section and the default voice’s own short section.
builtin_catalog
The catalogue a conversation can pick from when no config can be read.
catalog
The built-ins, with the config’s entries overriding by id or appended. An override that leaves out name or prompt keeps the built-in’s; on default only the icon is taken.
find
Look id up. Blank means the default.
section
The briefing’s persona section.
section_for
section that also tells the persona how to address the operator.
update_block
What a resumed session is told when the persona changed since the briefing it holds. None means the operator went back to the plain voice.
update_block_for
update_block naming the operator the way the briefing does.
validate
Check [[talk.personas]]: non-blank ids, unique ids, and no redefinition of default beyond its icon. Icons are validated only when served so a bad image never invalidates the conversation config. A built-in’s id may omit name and prompt (the built-in’s are kept); a new id may not.