- #65: update policies + per-agent version pinning - add settings.update_policy (stable/latest/skip) - add AgentDef.pin_version - honor both in update_cmd - add update_policy tests - #69: REPL color theme CLI command - add am theme [name] (show/switch) - persist selected theme to config - #72: doctor checks local model runtimes - verify ollama and llama-server on PATH - for ollama, also check server responds (ollama ls) Version 0.4.4
This commit is contained in:
@@ -102,6 +102,35 @@ pub struct Settings {
|
||||
/// lines (global; project profiles can add their own).
|
||||
#[serde(default)]
|
||||
pub hooks: BTreeMap<String, Vec<String>>,
|
||||
/// Update policy: how aggressively 'am update' should act (issue #65).
|
||||
#[serde(default)]
|
||||
pub update_policy: Option<UpdatePolicy>,
|
||||
}
|
||||
|
||||
/// Policy controlling how aggressively 'am update' upgrades installed agents.
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, Default, PartialEq, Eq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum UpdatePolicy {
|
||||
/// Never update automatically; 'am update --all' is a no-op.
|
||||
None,
|
||||
/// Default: update only when explicitly requested by name or with --all.
|
||||
#[default]
|
||||
Manual,
|
||||
/// Update only to the next patch/minor that is known safe (future use).
|
||||
Safe,
|
||||
/// Always update to the latest available version.
|
||||
Latest,
|
||||
}
|
||||
|
||||
impl UpdatePolicy {
|
||||
pub fn as_str(&self) -> &'static str {
|
||||
match self {
|
||||
UpdatePolicy::None => "none",
|
||||
UpdatePolicy::Manual => "manual",
|
||||
UpdatePolicy::Safe => "safe",
|
||||
UpdatePolicy::Latest => "latest",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A project profile: everything am needs to know about one project.
|
||||
@@ -172,6 +201,9 @@ pub struct AgentDef {
|
||||
/// Known version (otherwise detected via --version).
|
||||
#[serde(default)]
|
||||
pub version: Option<String>,
|
||||
/// Pinned version: 'am update' will refuse to install a different one (issue #65).
|
||||
#[serde(default)]
|
||||
pub pin_version: Option<String>,
|
||||
#[serde(default)]
|
||||
pub tags: Vec<String>,
|
||||
/// When false, the agent is listed but cannot be installed locally.
|
||||
|
||||
Reference in New Issue
Block a user