pub struct SparkConfig {
pub callsign: String,
pub class: String,
pub aura: String,
pub signal: String,
pub core: String,
}Expand description
Agent identity configuration.
All fields default to empty strings. When all fields are empty, the agent uses the default “Astrid” identity (zero behavior change).
Fields§
§callsign: StringAgent’s name (e.g. “Stellar”, “Nova”, “Orion”).
class: StringRole archetype (e.g. “navigator”, “engineer”, “sentinel”).
aura: StringPersonality energy (e.g. “calm”, “sharp”, “warm”, “analytical”).
signal: StringCommunication style (e.g. “formal”, “concise”, “casual”, “poetic”).
core: StringSoul/philosophy — free-form values, learned patterns, personality depth.
Implementations§
Source§impl SparkConfig
impl SparkConfig
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true when all fields are empty (no identity configured).
Sourcepub fn sanitize(&mut self)
pub fn sanitize(&mut self)
Sanitize all fields: trim whitespace, enforce length limits, and remove newlines from short fields. Whitespace-only fields become empty.
Sourcepub fn load_from_file(path: &Path) -> Option<SparkConfig>
pub fn load_from_file(path: &Path) -> Option<SparkConfig>
Load a spark config from a TOML file.
Returns None if the file is missing, too large, or cannot be parsed.
Sourcepub fn build_preamble(&self) -> Option<String>
pub fn build_preamble(&self) -> Option<String>
Build the identity preamble for system prompt injection.
When all fields are empty, returns None (caller should use the default
“Astrid” opening). When at least one field is set, builds a
structured identity block.
Sourcepub fn merge(&mut self, other: &SparkConfig)
pub fn merge(&mut self, other: &SparkConfig)
Merge another spark into this one, only updating non-empty fields.
Trait Implementations§
Source§impl Clone for SparkConfig
impl Clone for SparkConfig
Source§fn clone(&self) -> SparkConfig
fn clone(&self) -> SparkConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SparkConfig
impl Debug for SparkConfig
Source§impl Default for SparkConfig
impl Default for SparkConfig
Source§fn default() -> SparkConfig
fn default() -> SparkConfig
Source§impl<'de> Deserialize<'de> for SparkConfigwhere
SparkConfig: Default,
impl<'de> Deserialize<'de> for SparkConfigwhere
SparkConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SparkConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SparkConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for SparkConfig
impl Serialize for SparkConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for SparkConfig
impl RefUnwindSafe for SparkConfig
impl Send for SparkConfig
impl Sync for SparkConfig
impl Unpin for SparkConfig
impl UnsafeUnpin for SparkConfig
impl UnwindSafe for SparkConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more