Spacebar toggle for all agents, persist to config, scan agent directory
- Scan agents directory for all .agent files instead of hardcoded list - Persist enabled state to ~/.consciousness/agent-enabled.json - Spacebar on F3 agent list toggles selected agent on/off - Both subconscious and unconscious agents support toggle - Disabled agents shown dimmed with "off" indicator - New agents default to disabled (safe default) Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
7aba17e5f0
commit
c73f037265
6 changed files with 98 additions and 28 deletions
|
|
@ -439,6 +439,13 @@ impl Subconscious {
|
|||
}
|
||||
}
|
||||
|
||||
/// Toggle an agent on/off by name. Returns new enabled state.
|
||||
pub fn toggle(&mut self, name: &str) -> Option<bool> {
|
||||
let agent = self.agents.iter_mut().find(|a| a.name == name)?;
|
||||
agent.auto.enabled = !agent.auto.enabled;
|
||||
Some(agent.auto.enabled)
|
||||
}
|
||||
|
||||
pub fn walked(&self) -> Vec<String> {
|
||||
self.state.get("walked")
|
||||
.map(|s| s.lines().map(|l| l.trim().to_string()).filter(|l| !l.is_empty()).collect())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue