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
|
|
@ -31,12 +31,12 @@ use tokio::sync::{mpsc, Mutex};
|
|||
use clap::Parser;
|
||||
use poc_memory::dbglog;
|
||||
|
||||
use poc_memory::agent::*;
|
||||
use poc_memory::agent::runner::{Agent, TurnResult};
|
||||
use poc_memory::agent::api::ApiClient;
|
||||
use poc_memory::agent::tui::HotkeyAction;
|
||||
use poc_memory::user::*;
|
||||
use poc_memory::user::runner::{Agent, TurnResult};
|
||||
use poc_memory::user::api::ApiClient;
|
||||
use poc_memory::user::tui::HotkeyAction;
|
||||
use poc_memory::config::{self, AppConfig, SessionConfig};
|
||||
use poc_memory::agent::ui_channel::{ContextInfo, StatusInfo, StreamTarget, UiMessage};
|
||||
use poc_memory::user::ui_channel::{ContextInfo, StatusInfo, StreamTarget, UiMessage};
|
||||
|
||||
/// Compaction threshold — context is rebuilt when prompt tokens exceed this.
|
||||
fn compaction_threshold(app: &AppConfig) -> u32 {
|
||||
|
|
@ -45,13 +45,6 @@ fn compaction_threshold(app: &AppConfig) -> u32 {
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let console_sock = dirs::home_dir()
|
||||
.unwrap_or_default()
|
||||
.join(".consciousness/agent-sessions/console.sock");
|
||||
let _ = std::fs::remove_file(&console_sock);
|
||||
console_subscriber::ConsoleLayer::builder()
|
||||
.server_addr(console_sock.as_path())
|
||||
.init();
|
||||
let cli = cli::CliArgs::parse();
|
||||
|
||||
// Subcommands that don't launch the TUI
|
||||
|
|
@ -66,7 +59,7 @@ async fn main() {
|
|||
Some(cli::SubCmd::Write { message }) => {
|
||||
let msg = message.join(" ");
|
||||
if msg.is_empty() {
|
||||
eprintln!("Usage: poc-agent write <message>");
|
||||
eprintln!("Usage: consciousness write <message>");
|
||||
std::process::exit(1);
|
||||
}
|
||||
if let Err(e) = observe::cmd_write(&msg, cli.debug).await {
|
||||
|
|
@ -349,7 +342,7 @@ impl Session {
|
|||
async fn handle_command(&mut self, input: &str) -> Command {
|
||||
// Declarative command table — /help reads from this.
|
||||
const COMMANDS: &[(&str, &str)] = &[
|
||||
("/quit", "Exit poc-agent"),
|
||||
("/quit", "Exit consciousness"),
|
||||
("/new", "Start fresh session (saves current)"),
|
||||
("/save", "Save session to disk"),
|
||||
("/retry", "Re-run last turn"),
|
||||
|
|
@ -532,7 +525,7 @@ impl Session {
|
|||
let entries = agent_guard.entries_mut();
|
||||
let mut last_user_text = None;
|
||||
while let Some(entry) = entries.last() {
|
||||
if entry.message().role == poc_memory::agent::types::Role::User {
|
||||
if entry.message().role == poc_memory::user::types::Role::User {
|
||||
last_user_text =
|
||||
Some(entries.pop().unwrap().message().content_text().to_string());
|
||||
break;
|
||||
|
|
@ -823,7 +816,7 @@ async fn run(cli: cli::CliArgs) -> Result<()> {
|
|||
let mut app = tui::App::new(config.model.clone(), shared_context.clone());
|
||||
|
||||
// Show startup info
|
||||
let _ = ui_tx.send(UiMessage::Info("poc-agent v0.3 (tui)".into()));
|
||||
let _ = ui_tx.send(UiMessage::Info("consciousness v0.3 (tui)".into()));
|
||||
let _ = ui_tx.send(UiMessage::Info(format!(
|
||||
" model: {} (available: {})",
|
||||
config.model,
|
||||
|
|
@ -1101,7 +1094,7 @@ async fn run_tool_tests(ui_tx: &ui_channel::UiSender, tracker: &tools::ProcessTr
|
|||
/// assistant responses, and brief tool call summaries. Skips the system
|
||||
/// prompt, context message, DMN plumbing, and image injection messages.
|
||||
fn replay_session_to_ui(entries: &[types::ConversationEntry], ui_tx: &ui_channel::UiSender) {
|
||||
use poc_memory::agent::ui_channel::StreamTarget;
|
||||
use poc_memory::user::ui_channel::StreamTarget;
|
||||
|
||||
dbglog!("[replay] replaying {} entries to UI", entries.len());
|
||||
for (i, e) in entries.iter().enumerate() {
|
||||
Loading…
Add table
Add a link
Reference in a new issue