feat: greet on connect

This commit is contained in:
2026-01-16 12:41:50 -08:00
parent 2220c26c5e
commit 0dffec4d43
4 changed files with 95 additions and 1 deletions
+16
View File
@@ -40,6 +40,16 @@ pub struct HikariConfig {
#[serde(default)]
pub theme: Theme,
#[serde(default = "default_greeting_enabled")]
pub greeting_enabled: bool,
#[serde(default)]
pub greeting_custom_prompt: Option<String>,
}
fn default_greeting_enabled() -> bool {
true
}
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
@@ -63,6 +73,8 @@ mod tests {
assert!(config.mcp_servers_json.is_none());
assert!(config.auto_granted_tools.is_empty());
assert_eq!(config.theme, Theme::Dark);
assert!(!config.greeting_enabled);
assert!(config.greeting_custom_prompt.is_none());
}
#[test]
@@ -74,6 +86,8 @@ mod tests {
mcp_servers_json: None,
auto_granted_tools: vec!["Read".to_string(), "Glob".to_string()],
theme: Theme::Light,
greeting_enabled: true,
greeting_custom_prompt: Some("Hello!".to_string()),
};
let json = serde_json::to_string(&config).unwrap();
@@ -83,6 +97,8 @@ mod tests {
assert_eq!(deserialized.custom_instructions, config.custom_instructions);
assert_eq!(deserialized.auto_granted_tools, config.auto_granted_tools);
assert_eq!(deserialized.theme, Theme::Light);
assert!(deserialized.greeting_enabled);
assert_eq!(deserialized.greeting_custom_prompt, Some("Hello!".to_string()));
}
#[test]