feat: v0.7.0 — configuration post-install : bloc config: par agent (env_map + fichiers), adaptateurs TOML/YAML/JSON/key=value, édition douce, jamais de token en clair (api_key = @secret) (closes #91)

- Nouveau module src/agent_config.rs : apply_post_install (écriture fichiers), apply_env_map (env injectée au start/run), provider_pref (provider > config.provider_default > default_provider)
- am install écrit les fichiers de config de l'agent avec le provider/modèle résolus ; --no-config / install.configurable:false / --dry-run respectés ; agent sans adaptateur → message clair, install réussit
- Catalogue : blocs config: pour claude-code, codex, agentty (+ provider_default)
This commit is contained in:
2026-08-19 20:41:34 -04:00
parent ebc753cc4a
commit 68eb170f57
11 changed files with 627 additions and 6 deletions
+30
View File
@@ -342,6 +342,9 @@ pub struct AgentDef {
/// provider's default_model when unset.
#[serde(default)]
pub model: Option<String>,
/// Post-install provider configuration: env_map + files (issue #91).
#[serde(default)]
pub config: Option<AgentConfig>,
#[serde(default)]
pub tags: Vec<String>,
/// When false, the agent is listed but cannot be installed locally.
@@ -616,6 +619,33 @@ impl InstallSpec {
}
}
/// Post-install provider configuration of an agent (issue #91): the env vars
/// the agent expects and the config files to write or softly edit. The
/// api_key slot is always injected as the `@secret` reference (issue #89) —
/// a token is never written in clear.
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(default)]
pub struct AgentConfig {
/// Expected env vars, keyed by semantic slot (api_key / model /
/// base_url / provider) -> the agent's variable name.
pub env_map: BTreeMap<String, String>,
/// Configuration files to write or softly edit after the install.
pub files: Vec<AgentConfigFile>,
/// Provider of this agent, otherwise settings.default_provider.
pub provider_default: Option<String>,
}
/// One config file of an agent (issue #91).
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct AgentConfigFile {
/// File path (supports ~ and env vars).
pub path: String,
/// Keys to write among: api_key, model, base_url, provider.
#[serde(default)]
pub keys: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Dependency {