sessions : registre des sessions + commande am sessions (issue #5) - lifecycle agent/repl, reconciliation des sessions interrompues, compteur sessions_count, filtres agent/projet/statut, show avec extrait de log
This commit is contained in:
+7
-3
@@ -60,6 +60,7 @@ pub struct AmCompleter {
|
||||
const COMMAND_DESCRIPTIONS: &[(&str, &str)] = &[
|
||||
("list", "list installed agents"),
|
||||
("status", "show agent state"),
|
||||
("sessions", "list agent sessions"),
|
||||
("search", "search the catalog"),
|
||||
("info", "agent details"),
|
||||
("install", "install an agent"),
|
||||
@@ -136,7 +137,7 @@ impl AmCompleter {
|
||||
Self {
|
||||
theme: std::cell::Cell::new(crate::theme::default_theme()),
|
||||
commands: vec![
|
||||
"list", "status", "search", "info", "install", "uninstall", "update",
|
||||
"list", "status", "sessions", "search", "info", "install", "uninstall", "update",
|
||||
"start", "stop", "restart", "run", "doctor", "config", "completion",
|
||||
"self-update", "self-uninstall", "export", "import", "shell", "theme",
|
||||
"ls", "dir", "cd", "ps", "where", "get", "help", "version", "exit",
|
||||
@@ -890,8 +891,9 @@ pub fn run(app: &App) -> Result<i32> {
|
||||
.with_session(sid.clone())
|
||||
.with_cwd(Some(current_dir_string())),
|
||||
);
|
||||
let _ = crate::sessions::start_repl(app, &sid, Some(current_dir_string()));
|
||||
print!("{}", banner(app, &session, &sid));
|
||||
match run_with_editor(app, &mut session) {
|
||||
let result = match run_with_editor(app, &mut session) {
|
||||
Ok(code) => Ok(code),
|
||||
Err(e) => {
|
||||
app.log.verbose(&format!(
|
||||
@@ -899,7 +901,9 @@ pub fn run(app: &App) -> Result<i32> {
|
||||
));
|
||||
run_plain(app, &mut session)
|
||||
}
|
||||
}
|
||||
};
|
||||
let _ = crate::sessions::finish_repl(app, &sid);
|
||||
result
|
||||
}
|
||||
|
||||
fn run_with_editor(app: &App, session: &mut ShellSession) -> Result<i32> {
|
||||
|
||||
Reference in New Issue
Block a user