feat: phase 2 — am lab (benchmark N agents) + plugins d'événements (contrat JSON)

- #62: am lab --agents a,b --task <f> — séquentiel ou --parallel, capture
  durée/exit/sortie/coût estimé, rapport comparatif tableau + --json stable,
  tâches versionnables dans <state>/lab/ (--list), rejouables à l'identique
- #75: plugins/ sous state_dir, déclenchés sur on_install/on_start/on_stop/
  on_update (App::emit), contrat JSON stdin/stdout, timeout configurable,
  échec non bloquant, garde anti-récursion AM_PLUGINS_RUNNING, am plugins
  + am plugins --test <name> (CI), exemples notify + ci-webhook
- intégration REPL (parse, complétion, bannière, is_am_command), help, tips,
  man pages (am-lab.1, am-plugins.1), README, ROADMAP (26/27), v0.5.4
- 334 tests verts (309 + 25)

closes #62
closes #75
This commit is contained in:
2026-08-18 14:17:30 -04:00
parent aa0d8e43eb
commit 4c7866a25a
29 changed files with 2123 additions and 8 deletions
+18 -1
View File
@@ -116,6 +116,8 @@ const COMMAND_DESCRIPTIONS: &[(&str, &str)] = &[
("sync", "push the state (journal, sessions, config) into a git repo"),
("migrate", "export/import a machine transfer bundle (config + state)"),
("playbook", "replay a saved history sequence step by step (am history --save)"),
("lab", "benchmark the same task on several agents (duration, cost, --json)"),
("plugins", "list the event plugins and test one (JSON contract on stdin/stdout)"),
("shell", "show or switch the system shell"),
("theme", "show or switch the color theme"),
("tip", "cheat sheet of the most useful commands"),
@@ -230,7 +232,7 @@ impl AmCompleter {
"self-update", "self-uninstall", "export", "import", "shell", "theme",
"tip", "dashboard", "favorite", "unfavorite", "note", "tag", "untag", "tags",
"profile", "man", "models", "catalog", "suggest", "audit",
"service", "schedule", "monitor", "sync", "migrate", "playbook",
"service", "schedule", "monitor", "sync", "migrate", "playbook", "lab", "plugins",
"ls", "dir", "cd", "ps", "where", "get", "help", "version", "exit",
],
config_sub: vec!["show", "path", "edit", "validate", "add"],
@@ -782,6 +784,9 @@ pub fn banner_box(
rows.push(inner(
" automate service install · schedule add · doctor --watch · monitor · sync · migrate · playbook".to_string(),
));
rows.push(inner(
" bench lab --agents a,b --task t.yaml · plugins · plugins --test <name>".to_string(),
));
rows.push(inner(
" system self-update · self-uninstall · export · import".to_string(),
));
@@ -1617,6 +1622,16 @@ fn handle_line(
.collect(),
}
},
"lab" => Command::Lab(crate::cli::LabArgs {
agents: opt_value("--agents"),
task: opt_value("--task").map(std::path::PathBuf::from),
parallel: flag("--parallel"),
timeout: opt_value("--timeout").and_then(|v| v.parse().ok()),
list: flag("--list"),
}),
"plugins" => Command::Plugins(crate::cli::PluginsArgs {
test: opt_value("--test"),
}),
"init" => Command::Init {
force: flag("--force"),
template: opt_value("--template"),
@@ -1864,6 +1879,8 @@ pub fn is_am_command(word: &str) -> bool {
| "sync"
| "migrate"
| "playbook"
| "lab"
| "plugins"
)
}