Rename agent/ to user/ and poc-agent binary to consciousness
Mechanical rename: src/agent/ -> src/user/, all crate::agent:: -> crate::user:: references updated. Binary poc-agent renamed to consciousness with CLI name and user-facing strings updated. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
beb49ec477
commit
14dd8d22af
31 changed files with 1857 additions and 1468 deletions
58
src/user/tui/thalamus_screen.rs
Normal file
58
src/user/tui/thalamus_screen.rs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
// thalamus_screen.rs — F5: attention routing / daemon status
|
||||
//
|
||||
// Shows poc-daemon status: presence detection, idle timer,
|
||||
// notification routing, activity level.
|
||||
|
||||
use ratatui::{
|
||||
layout::Rect,
|
||||
style::{Color, Style},
|
||||
text::Line,
|
||||
widgets::{Block, Borders, Paragraph, Wrap},
|
||||
Frame,
|
||||
};
|
||||
|
||||
use super::{App, SCREEN_LEGEND};
|
||||
|
||||
fn fetch_daemon_status() -> Vec<String> {
|
||||
std::process::Command::new("poc-daemon")
|
||||
.arg("status")
|
||||
.output()
|
||||
.ok()
|
||||
.and_then(|o| {
|
||||
if o.status.success() {
|
||||
String::from_utf8(o.stdout).ok()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.map(|s| s.lines().map(String::from).collect())
|
||||
.unwrap_or_else(|| vec!["daemon not running".to_string()])
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub(crate) fn draw_thalamus(&self, frame: &mut Frame, size: Rect) {
|
||||
let status_lines = fetch_daemon_status();
|
||||
let section = Style::default().fg(Color::Yellow);
|
||||
|
||||
let mut lines: Vec<Line> = Vec::new();
|
||||
lines.push(Line::styled("── Thalamus ──", section));
|
||||
lines.push(Line::raw(""));
|
||||
|
||||
for line in &status_lines {
|
||||
lines.push(Line::raw(format!(" {}", line)));
|
||||
}
|
||||
|
||||
let block = Block::default()
|
||||
.title_top(Line::from(SCREEN_LEGEND).left_aligned())
|
||||
.title_top(Line::from(" thalamus ").right_aligned())
|
||||
.borders(Borders::ALL)
|
||||
.border_style(Style::default().fg(Color::Cyan));
|
||||
|
||||
let para = Paragraph::new(lines)
|
||||
.block(block)
|
||||
.wrap(Wrap { trim: false })
|
||||
.scroll((self.debug_scroll, 0));
|
||||
|
||||
frame.render_widget(para, size);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue