generated from nhcarrigan/template
feat: add automatic greeting upon connection (#42)
### Explanation _No response_ ### Issue Closes #23 ### Attestations - [ ] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/) - [ ] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/). - [ ] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/). ### Dependencies - [ ] I have pinned the dependencies to a specific patch version. ### Style - [ ] I have run the linter and resolved any errors. - [ ] My pull request uses an appropriate title, matching the conventional commit standards. - [ ] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request. ### Tests - [ ] My contribution adds new code, and I have added tests to cover it. - [ ] My contribution modifies existing code, and I have updated the tests to reflect these changes. - [ ] All new and existing tests pass locally with my changes. - [ ] Code coverage remains at or above the configured threshold. ### Documentation _No response_ ### Versioning _No response_ Reviewed-on: #42 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit was merged in pull request #42.
This commit is contained in:
+32
-1
@@ -21,7 +21,7 @@ pub struct ClaudeStartOptions {
|
||||
pub allowed_tools: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct HikariConfig {
|
||||
#[serde(default)]
|
||||
pub model: Option<String>,
|
||||
@@ -40,6 +40,31 @@ 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>,
|
||||
}
|
||||
|
||||
impl Default for HikariConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
model: None,
|
||||
api_key: None,
|
||||
custom_instructions: None,
|
||||
mcp_servers_json: None,
|
||||
auto_granted_tools: Vec::new(),
|
||||
theme: Theme::default(),
|
||||
greeting_enabled: true,
|
||||
greeting_custom_prompt: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn default_greeting_enabled() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
|
||||
@@ -63,6 +88,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 +101,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 +112,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]
|
||||
|
||||
Reference in New Issue
Block a user