replace hardcoded personal names with config values
User and assistant names now come from config.user_name and
config.assistant_name throughout: system prompt, DMN prompts,
debug screen, and all agent files. Agent templates use
{user_name} and {assistant_name} placeholders.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
1fd4ce05c1
commit
33e45f6ce8
21 changed files with 75 additions and 63 deletions
|
|
@ -35,7 +35,7 @@ struct Status {
|
|||
consolidating @5 :Bool;
|
||||
dreaming @6 :Bool;
|
||||
fired @7 :Bool;
|
||||
kentPresent @8 :Bool;
|
||||
userPresent @8 :Bool;
|
||||
uptime @9 :Float64;
|
||||
activity @10 :Activity;
|
||||
pendingCount @11 :UInt32;
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ impl Default for IrcConfig {
|
|||
server: "irc.libera.chat".into(),
|
||||
port: 6697,
|
||||
tls: true,
|
||||
nick: "ProofOfConcept".into(),
|
||||
user: "poc".into(),
|
||||
realname: "ProofOfConcept".into(),
|
||||
nick: "agent".into(),
|
||||
user: "agent".into(),
|
||||
realname: "agent".into(),
|
||||
channels: vec!["#bcachefs".into(), "#bcachefs-ai".into()],
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -243,8 +243,8 @@ impl State {
|
|||
self.decay_ewma();
|
||||
self.in_turn = true;
|
||||
self.turn_start = now();
|
||||
let from_kent = !self.fired;
|
||||
if from_kent {
|
||||
let from_user = !self.fired;
|
||||
if from_user {
|
||||
self.last_user_msg = now();
|
||||
self.notifications.set_activity(notify::Activity::Focused);
|
||||
}
|
||||
|
|
@ -253,7 +253,7 @@ impl State {
|
|||
self.claude_pane = Some(pane.to_string());
|
||||
}
|
||||
self.save();
|
||||
info!("user (pane={}, kent={from_kent}) ewma={:.3}",
|
||||
info!("user (pane={}, {user}={from_user}) ewma={:.3}",
|
||||
if pane.is_empty() { "unchanged" } else { pane },
|
||||
self.activity_ewma);
|
||||
}
|
||||
|
|
@ -277,7 +277,7 @@ impl State {
|
|||
/// Only injects into tmux when idle — if there's an active session
|
||||
/// (recent user or response), the hook delivers via additionalContext.
|
||||
pub fn maybe_prompt_notification(&mut self, ntype: &str, urgency: u8, _message: &str) {
|
||||
if self.kent_present() {
|
||||
if self.user_present() {
|
||||
return; // hook will deliver it on next prompt
|
||||
}
|
||||
// If we've responded recently, the session is active —
|
||||
|
|
@ -297,10 +297,10 @@ impl State {
|
|||
}
|
||||
|
||||
pub fn handle_afk(&mut self) {
|
||||
// Push last_user_msg far enough back that kent_present() returns false
|
||||
// Push last_user_msg far enough back that user_present() returns false
|
||||
self.last_user_msg = now() - self.session_active_secs - 1.0;
|
||||
self.fired = false; // allow idle timer to fire again
|
||||
info!("Kent marked AFK");
|
||||
info!("User marked AFK");
|
||||
self.save();
|
||||
}
|
||||
|
||||
|
|
@ -356,7 +356,7 @@ impl State {
|
|||
info!("quiet {seconds}s");
|
||||
}
|
||||
|
||||
pub fn kent_present(&self) -> bool {
|
||||
pub fn user_present(&self) -> bool {
|
||||
(now() - self.last_user_msg) < self.session_active_secs
|
||||
}
|
||||
|
||||
|
|
@ -379,8 +379,8 @@ impl State {
|
|||
"consolidating"
|
||||
} else if self.dreaming {
|
||||
"dreaming"
|
||||
} else if self.kent_present() {
|
||||
"kent present"
|
||||
} else if self.user_present() {
|
||||
"user present"
|
||||
} else if self.in_turn {
|
||||
"in turn"
|
||||
} else if self.last_response.max(self.last_user_msg) == 0.0 {
|
||||
|
|
@ -413,7 +413,7 @@ impl State {
|
|||
"activity_ewma": self.activity_ewma,
|
||||
"in_turn": self.in_turn,
|
||||
"turn_start": self.turn_start,
|
||||
"kent_present": self.kent_present(),
|
||||
"user_present": self.user_present(),
|
||||
"claude_pane": self.claude_pane,
|
||||
"fired": self.fired,
|
||||
"block_reason": self.block_reason(),
|
||||
|
|
@ -538,8 +538,8 @@ impl State {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
// Don't nudge while Kent is here — conversation drives activity
|
||||
if self.kent_present() {
|
||||
// Don't nudge while User is here — conversation drives activity
|
||||
if self.user_present() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ impl State {
|
|||
|
||||
let dream_hours = hours_since_last_dream();
|
||||
let mut msg = format!(
|
||||
"This is your autonomous time (Kent AFK {elapsed_min}m). \
|
||||
"This is your autonomous time (User AFK {elapsed_min}m). \
|
||||
Keep doing what you're doing, or find something new to do");
|
||||
if dream_hours >= DREAM_INTERVAL_HOURS {
|
||||
msg.push_str(&format!(
|
||||
|
|
|
|||
|
|
@ -84,9 +84,9 @@ enum Command {
|
|||
/// Duration in seconds
|
||||
seconds: Option<u32>,
|
||||
},
|
||||
/// Mark Kent as AFK (immediately allow idle timer to fire)
|
||||
/// Mark user as AFK (immediately allow idle timer to fire)
|
||||
Afk,
|
||||
/// Set session active timeout in seconds (how long after last message Kent counts as "present")
|
||||
/// Set session active timeout in seconds (how long after last message user counts as "present")
|
||||
SessionTimeout {
|
||||
/// Timeout in seconds
|
||||
seconds: f64,
|
||||
|
|
@ -221,8 +221,8 @@ async fn client_main(cmd: Command) -> Result<(), Box<dyn std::error::Error>> {
|
|||
fmt_secs(s.get_since_activity()),
|
||||
fmt_secs(s.get_notify_timeout()),
|
||||
);
|
||||
println!("kent: {} (last {}) activity: {:.1}%",
|
||||
if s.get_kent_present() { "present" } else { "away" },
|
||||
println!("user: {} (last {}) activity: {:.1}%",
|
||||
if s.get_user_present() { "present" } else { "away" },
|
||||
fmt_secs(s.get_since_user()),
|
||||
s.get_activity_ewma() * 100.0,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ fn classify_privmsg(nick: &str, target: &str, text: &str, my_nick: &str) -> (Str
|
|||
}
|
||||
|
||||
/// Append a message to the per-channel or per-user log file.
|
||||
/// Logs go to ~/.consciousness/irc/logs/{target}.log (e.g. #bcachefs.log, pm-kent.log)
|
||||
/// Logs go to ~/.consciousness/irc/logs/{target}.log (e.g. #bcachefs.log, pm-user.log)
|
||||
fn append_log(target: &str, nick: &str, text: &str) {
|
||||
use std::io::Write;
|
||||
// Sanitize target for filename (strip leading #, lowercase)
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ pub async fn handle_command(
|
|||
.map_err(|e| e.to_string())?;
|
||||
|
||||
let ts = timestamp();
|
||||
append_history(&format!("{ts} [ProofOfConcept] {msg}"));
|
||||
append_history(&format!("{ts} [agent] {msg}"));
|
||||
|
||||
Ok("sent".to_string())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ impl daemon::Server for DaemonImpl {
|
|||
format!("\n{ctx}")
|
||||
};
|
||||
let msg = format!(
|
||||
"This is your time (Kent AFK, test nudge). \
|
||||
"This is your time (User AFK, test nudge). \
|
||||
Let your feelings guide your thinking.{extra}"
|
||||
);
|
||||
let ok = state.send(&msg);
|
||||
|
|
@ -250,7 +250,7 @@ impl daemon::Server for DaemonImpl {
|
|||
status.set_consolidating(s.consolidating);
|
||||
status.set_dreaming(s.dreaming);
|
||||
status.set_fired(s.fired);
|
||||
status.set_kent_present(s.kent_present());
|
||||
status.set_user_present(s.user_present());
|
||||
status.set_uptime(crate::now() - s.start_time);
|
||||
status.set_activity(match s.notifications.activity {
|
||||
notify::Activity::Idle => crate::daemon_capnp::Activity::Idle,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue