//! One knowledge entry: what the mount indexes at each address. use std::path::PathBuf; use serde_yaml_ng::Value; /// Who can see an entry's content. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Visibility { /// The player can see this. Public, /// The player knows something happened but not what. Screened, /// The player sees nothing. Secret, } /// One entry in the knowledge tree: an entry file's parsed frontmatter /// and body, plus where it lives on disk. #[derive(Debug, Clone, PartialEq, Eq)] pub struct Entry { /// The entry's address, as walked from its layer's `rules/` or /// `lore/` root, without the `.md` extension: `rules/monsters/goblin`. /// Keeps the on-disk casing; the mount's own lookup key is /// lowercased separately. pub address: String, /// Where the entry file lives on disk. pub path: PathBuf, /// The layer directory that supplied this entry. pub layer: PathBuf, /// The frontmatter `name` field. pub name: String, /// The frontmatter `type` field, when the entry has one. pub kind: Option, /// The markdown body, after the frontmatter block. pub body: String, /// The file's full text, frontmatter and body together, verbatim. pub text: String, /// Whether this entry is pushed into every turn's system prompt. pub context: bool, /// Who can see this entry. `None` means `Public`. pub visibility: Option, /// Every frontmatter field, as parsed YAML. The typed fields above /// are also in here; this map is what `lookup` filters against. pub frontmatter: Value, }