fmt: Applied uniform formatting across all files
This commit is contained in:
@@ -101,15 +101,15 @@ fn extract_agent_from_args() -> Option<String> {
|
|||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
while i < args.len() {
|
while i < args.len() {
|
||||||
let arg = &args[i];
|
let arg = &args[i];
|
||||||
|
|
||||||
if let Some(value) = arg.strip_prefix("--agent=") {
|
if let Some(value) = arg.strip_prefix("--agent=") {
|
||||||
return Some(value.to_string());
|
return Some(value.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg == "--agent" || arg == "-a") && i + 1 < args.len() {
|
if (arg == "--agent" || arg == "-a") && i + 1 < args.len() {
|
||||||
return Some(args[i + 1].clone());
|
return Some(args[i + 1].clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
@@ -117,14 +117,14 @@ fn extract_agent_from_args() -> Option<String> {
|
|||||||
|
|
||||||
pub(super) fn session_completer(current: &OsStr) -> Vec<CompletionCandidate> {
|
pub(super) fn session_completer(current: &OsStr) -> Vec<CompletionCandidate> {
|
||||||
let cur = current.to_string_lossy();
|
let cur = current.to_string_lossy();
|
||||||
|
|
||||||
let sessions = if let Some(agent_name) = extract_agent_from_args() {
|
let sessions = if let Some(agent_name) = extract_agent_from_args() {
|
||||||
let sessions_dir = paths::agent_data_dir(&agent_name).join("sessions");
|
let sessions_dir = paths::agent_data_dir(&agent_name).join("sessions");
|
||||||
list_file_names(sessions_dir, ".yaml")
|
list_file_names(sessions_dir, ".yaml")
|
||||||
} else {
|
} else {
|
||||||
list_sessions()
|
list_sessions()
|
||||||
};
|
};
|
||||||
|
|
||||||
sessions
|
sessions
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|s| s.starts_with(&*cur))
|
.filter(|s| s.starts_with(&*cur))
|
||||||
|
|||||||
+4
-4
@@ -102,9 +102,7 @@ impl Role {
|
|||||||
"max_auto_continues" => {
|
"max_auto_continues" => {
|
||||||
role.max_auto_continues = value.as_u64().map(|v| v as usize)
|
role.max_auto_continues = value.as_u64().map(|v| v as usize)
|
||||||
}
|
}
|
||||||
"inject_todo_instructions" => {
|
"inject_todo_instructions" => role.inject_todo_instructions = value.as_bool(),
|
||||||
role.inject_todo_instructions = value.as_bool()
|
|
||||||
}
|
|
||||||
"continuation_prompt" => {
|
"continuation_prompt" => {
|
||||||
role.continuation_prompt = value.as_str().map(|v| v.to_string())
|
role.continuation_prompt = value.as_str().map(|v| v.to_string())
|
||||||
}
|
}
|
||||||
@@ -156,7 +154,9 @@ impl Role {
|
|||||||
metadata.push(format!("max_auto_continues: {max_auto_continues}"));
|
metadata.push(format!("max_auto_continues: {max_auto_continues}"));
|
||||||
}
|
}
|
||||||
if let Some(inject_todo_instructions) = self.inject_todo_instructions {
|
if let Some(inject_todo_instructions) = self.inject_todo_instructions {
|
||||||
metadata.push(format!("inject_todo_instructions: {inject_todo_instructions}"));
|
metadata.push(format!(
|
||||||
|
"inject_todo_instructions: {inject_todo_instructions}"
|
||||||
|
));
|
||||||
}
|
}
|
||||||
if let Some(continuation_prompt) = &self.continuation_prompt {
|
if let Some(continuation_prompt) = &self.continuation_prompt {
|
||||||
metadata.push(format!("continuation_prompt: {continuation_prompt}"));
|
metadata.push(format!("continuation_prompt: {continuation_prompt}"));
|
||||||
|
|||||||
@@ -252,7 +252,10 @@ impl Session {
|
|||||||
items.push(("max_auto_continues", max_auto_continues.to_string()));
|
items.push(("max_auto_continues", max_auto_continues.to_string()));
|
||||||
}
|
}
|
||||||
if let Some(inject_todo_instructions) = self.inject_todo_instructions() {
|
if let Some(inject_todo_instructions) = self.inject_todo_instructions() {
|
||||||
items.push(("inject_todo_instructions", inject_todo_instructions.to_string()));
|
items.push((
|
||||||
|
"inject_todo_instructions",
|
||||||
|
inject_todo_instructions.to_string(),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
if let Some(continuation_prompt) = self.continuation_prompt() {
|
if let Some(continuation_prompt) = self.continuation_prompt() {
|
||||||
items.push(("continuation_prompt", continuation_prompt.to_string()));
|
items.push(("continuation_prompt", continuation_prompt.to_string()));
|
||||||
|
|||||||
Reference in New Issue
Block a user