Rename mind/dmn.rs to mind/subconscious.rs
The file contains both the DMN state machine and the subconscious agent orchestration. Renaming to match the conceptual grouping — next step is adding mind/unconscious.rs for the standalone graph maintenance agents (organize, linker, etc.) that don't need conversation context. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
24b211dc35
commit
9704e7a698
4 changed files with 28 additions and 28 deletions
|
|
@ -68,22 +68,22 @@ fn commands() -> Vec<SlashCommand> { vec![
|
|||
SlashCommand { name: "/sleep", help: "Put DMN to sleep",
|
||||
handler: |s, _| {
|
||||
let mut st = s.shared_mind.lock().unwrap();
|
||||
st.dmn = crate::mind::dmn::State::Resting { since: std::time::Instant::now() };
|
||||
st.dmn = crate::mind::subconscious::State::Resting { since: std::time::Instant::now() };
|
||||
st.dmn_turns = 0;
|
||||
if let Ok(mut ag) = s.agent.state.try_lock() { ag.notify("DMN sleeping"); }
|
||||
} },
|
||||
SlashCommand { name: "/wake", help: "Wake DMN to foraging",
|
||||
handler: |s, _| {
|
||||
let mut st = s.shared_mind.lock().unwrap();
|
||||
if matches!(st.dmn, crate::mind::dmn::State::Off) { crate::mind::dmn::set_off(false); }
|
||||
st.dmn = crate::mind::dmn::State::Foraging;
|
||||
if matches!(st.dmn, crate::mind::subconscious::State::Off) { crate::mind::subconscious::set_off(false); }
|
||||
st.dmn = crate::mind::subconscious::State::Foraging;
|
||||
st.dmn_turns = 0;
|
||||
if let Ok(mut ag) = s.agent.state.try_lock() { ag.notify("DMN foraging"); }
|
||||
} },
|
||||
SlashCommand { name: "/pause", help: "Full stop — no autonomous ticks (Ctrl+P)",
|
||||
handler: |s, _| {
|
||||
let mut st = s.shared_mind.lock().unwrap();
|
||||
st.dmn = crate::mind::dmn::State::Paused;
|
||||
st.dmn = crate::mind::subconscious::State::Paused;
|
||||
st.dmn_turns = 0;
|
||||
if let Ok(mut ag) = s.agent.state.try_lock() { ag.notify("DMN paused"); }
|
||||
} },
|
||||
|
|
|
|||
|
|
@ -232,22 +232,22 @@ async fn hotkey_kill_processes(mind: &crate::mind::Mind) {
|
|||
fn hotkey_cycle_autonomy(mind: &crate::mind::Mind) {
|
||||
let mut s = mind.shared.lock().unwrap();
|
||||
let label = match &s.dmn {
|
||||
crate::mind::dmn::State::Engaged | crate::mind::dmn::State::Working | crate::mind::dmn::State::Foraging => {
|
||||
s.dmn = crate::mind::dmn::State::Resting { since: std::time::Instant::now() };
|
||||
crate::mind::subconscious::State::Engaged | crate::mind::subconscious::State::Working | crate::mind::subconscious::State::Foraging => {
|
||||
s.dmn = crate::mind::subconscious::State::Resting { since: std::time::Instant::now() };
|
||||
"resting"
|
||||
}
|
||||
crate::mind::dmn::State::Resting { .. } => {
|
||||
s.dmn = crate::mind::dmn::State::Paused;
|
||||
crate::mind::subconscious::State::Resting { .. } => {
|
||||
s.dmn = crate::mind::subconscious::State::Paused;
|
||||
"PAUSED"
|
||||
}
|
||||
crate::mind::dmn::State::Paused => {
|
||||
crate::mind::dmn::set_off(true);
|
||||
s.dmn = crate::mind::dmn::State::Off;
|
||||
crate::mind::subconscious::State::Paused => {
|
||||
crate::mind::subconscious::set_off(true);
|
||||
s.dmn = crate::mind::subconscious::State::Off;
|
||||
"OFF (persists across restarts)"
|
||||
}
|
||||
crate::mind::dmn::State::Off => {
|
||||
crate::mind::dmn::set_off(false);
|
||||
s.dmn = crate::mind::dmn::State::Foraging;
|
||||
crate::mind::subconscious::State::Off => {
|
||||
crate::mind::subconscious::set_off(false);
|
||||
s.dmn = crate::mind::subconscious::State::Foraging;
|
||||
"foraging"
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue