feat(tui): implement agent turn engine for background processing and enhance input handling

This commit is contained in:
asepharyana
2026-07-20 10:55:09 +07:00
parent da2ed6da25
commit 792695b65a
31 changed files with 603 additions and 153 deletions
+5 -4
View File
@@ -4,13 +4,14 @@
//! schema for each one. Standalone CLI tool invoked as `cargo run --bin migrate`.
use std::path::Path;
use tracing;
fn main() -> anyhow::Result<()> {
let store = zesdex_domain::core::Store::new();
let sessions_dir = store.base_dir.join("sessions");
if !sessions_dir.exists() {
eprintln!("No sessions directory found, nothing to migrate");
tracing::info!("No sessions directory found, nothing to migrate");
return Ok(());
}
@@ -27,16 +28,16 @@ fn main() -> anyhow::Result<()> {
match migrate_session_msglog(&path) {
Ok(_) => {
migrated += 1;
eprintln!("Migrated session: {:?}", path.file_name());
tracing::info!("Migrated session: {:?}", path.file_name());
}
Err(e) => {
failed += 1;
eprintln!("Failed to migrate session {:?}: {e}", path.file_name());
tracing::error!("Failed to migrate session {:?}: {e}", path.file_name());
}
}
}
eprintln!("Migration complete: {migrated} succeeded, {failed} failed");
tracing::info!("Migration complete: {migrated} succeeded, {failed} failed");
if failed > 0 {
anyhow::bail!("{failed} session(s) failed to migrate");
}
+8 -6
View File
@@ -4,6 +4,8 @@
//! configuration files plus a seed session for development/testing.
//! Invoked as `cargo run --bin seed`.
use tracing;
fn main() -> anyhow::Result<()> {
let store = zesdex_domain::core::Store::new();
store.ensure_dirs()?;
@@ -18,9 +20,9 @@ fn main() -> anyhow::Result<()> {
let f = std::fs::File::open(&tmp)?;
f.sync_all()?;
std::fs::rename(&tmp, settings_path)?;
println!("Default settings created");
tracing::info!("Default settings created");
} else {
println!("Settings already exist, skipping");
tracing::info!("Settings already exist, skipping");
}
// Create default app config if not present
@@ -33,15 +35,15 @@ fn main() -> anyhow::Result<()> {
let f = std::fs::File::open(&tmp)?;
f.sync_all()?;
std::fs::rename(&tmp, config_path)?;
println!("Default app_config created");
tracing::info!("Default app_config created");
} else {
println!("App config already exists, skipping");
tracing::info!("App config already exists, skipping");
}
// Create data directories
std::fs::create_dir_all(&store.memory_dir)?;
std::fs::create_dir_all(&store.session_images_dir)?;
println!("All store directories verified");
tracing::info!("All store directories verified");
// Create a seed session
let session_id = uuid::Uuid::new_v4().to_string();
@@ -53,7 +55,7 @@ fn main() -> anyhow::Result<()> {
use zesdex_domain::SessionRepository;
let repo = zesdex_infrastructure::persistence::iam::session_repo::FileSystemSessionRepository::new();
repo.save_session(&store.base_dir, &session)?;
println!("Seed session created: id={session_id}");
tracing::info!("Seed session created: id={session_id}");
Ok(())
}