haest-cli 0.4.0

haest, the command line agent
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `haest sessions`: one line per saved session.

use haest::{core::session::iso_utc, runtime::SessionInfo};

/// `2026-11-10 08:30Z  <id>  <cwd>  <preview>`.
pub(crate) fn format_row(s: &SessionInfo, show_cwd: bool) -> String {
    let when = iso_utc(s.modified_ms);
    let when = format!("{} {}Z", &when[..10], &when[11..16]);
    let cwd = if show_cwd {
        format!("  {}", s.cwd.display())
    } else {
        String::new()
    };
    let row = format!("{when}  {}{cwd}  {}", s.id, s.preview);
    crate::render::inert(&row).into_owned()
}