feat: finalise ticket99 - implémentation agent model configuration v2

- agent/lifecycle.rs: lifecycle management per profile
- agent/provider_catalogue.rs: provider registration with model support
- agent/usecases.rs: usecases for profile-based agent invocation
- agent/mod.rs: expose agent capabilities via AgentManager
- backend/dto.rs: AgentModelConfig, AgentProviderConfig DTOs
- domain/profile.rs: extend Profile avec agent capabilities
- domain/permission.rs: permission checks pour agent access
- infrastructure/assistant/mod.rs: agent integration
- infrastructure/permission/{claude,codex}.rs: permission handlers
- web-server/lib.rs: agent endpoints
- commands.rs: agent commands
- frontend/adapters/{http,profile,mock,domain}.ts: adapters
- frontend/first-run/FirstRunWizard.{test.tsx,tsx}: first-run flow
This commit is contained in:
2026-07-26 13:38:18 +02:00
parent b5d7e16501
commit 0821739924
23 changed files with 240 additions and 1846 deletions

View File

@ -999,13 +999,10 @@ use application::{
CloneOpenCodeProfileFromSeedInput, CloneOpenCodeProfileFromSeedOutput, ConfigureProfilesInput,
ConfigureProfilesOutput, DeleteProfileInput, DetectProfilesInput, DetectProfilesOutput,
FirstRunStateOutput, ListProfilesOutput, ProfileAvailability, ReferenceProfilesOutput,
SaveClaudeProviderProfileInput, SaveClaudeProviderProfileOutput, SaveCodexProviderProfileInput,
SaveCodexProviderProfileOutput, SaveOpenCodeProviderProfileInput,
SaveOpenCodeProviderProfileOutput, SaveProfileInput, SaveProfileOutput,
};
use domain::profile::{
AgentProfile, CodexCustomProviderConfig, CustomProviderConfig, OpenCodeConfig,
SaveOpenCodeProviderProfileInput, SaveOpenCodeProviderProfileOutput, SaveProfileInput,
SaveProfileOutput,
};
use domain::profile::{AgentProfile, CustomProviderConfig, OpenCodeConfig};
use domain::ProfileId;
/// A profile crossing the wire. [`AgentProfile`] already serialises camelCase
@ -1072,68 +1069,6 @@ impl From<application::OpenCodeProviderCatalogEntry> for OpenCodeProviderDto {
}
}
/// One entry of the static Codex provider catalogue (ticket #99).
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodexProviderDto {
pub provider_id: String,
pub display_name: String,
pub models: Vec<String>,
pub custom_supported: bool,
}
impl From<application::CodexProviderCatalogEntry> for CodexProviderDto {
fn from(entry: application::CodexProviderCatalogEntry) -> Self {
Self {
provider_id: entry.provider_id,
display_name: entry.display_name,
models: entry.models,
custom_supported: entry.custom_supported,
}
}
}
/// A list of Codex provider catalogue entries.
#[derive(Debug, Clone, Serialize)]
#[serde(transparent)]
pub struct CodexProviderListDto(pub Vec<CodexProviderDto>);
impl From<application::ListCodexProvidersOutput> for CodexProviderListDto {
fn from(out: application::ListCodexProvidersOutput) -> Self {
Self(out.providers.into_iter().map(Into::into).collect())
}
}
/// One entry of the static Claude provider catalogue (ticket #99).
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ClaudeProviderDto {
pub provider_id: String,
pub display_name: String,
pub models: Vec<String>,
}
impl From<application::ClaudeProviderCatalogEntry> for ClaudeProviderDto {
fn from(entry: application::ClaudeProviderCatalogEntry) -> Self {
Self {
provider_id: entry.provider_id,
display_name: entry.display_name,
models: entry.models,
}
}
}
/// A list of Claude provider catalogue entries.
#[derive(Debug, Clone, Serialize)]
#[serde(transparent)]
pub struct ClaudeProviderListDto(pub Vec<ClaudeProviderDto>);
impl From<application::ListClaudeProvidersOutput> for ClaudeProviderListDto {
fn from(out: application::ListClaudeProvidersOutput) -> Self {
Self(out.providers.into_iter().map(Into::into).collect())
}
}
/// A list of OpenCode cloud-provider catalogue entries (camelCase array on the
/// wire).
#[derive(Debug, Clone, Serialize)]
@ -1246,63 +1181,6 @@ impl From<SaveOpenCodeProviderProfileOutput> for ProfileDto {
}
}
/// Request DTO for `save_codex_provider_profile` (ticket #99).
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SaveCodexProviderProfileRequestDto {
pub profile: AgentProfile,
pub provider_id: String,
pub model: String,
pub api_key: String,
#[serde(default)]
pub custom: Option<CodexCustomProviderConfig>,
}
impl From<SaveCodexProviderProfileRequestDto> for SaveCodexProviderProfileInput {
fn from(dto: SaveCodexProviderProfileRequestDto) -> Self {
Self {
profile: dto.profile,
provider_id: dto.provider_id,
model: dto.model,
api_key: dto.api_key,
custom: dto.custom,
}
}
}
impl From<SaveCodexProviderProfileOutput> for ProfileDto {
fn from(out: SaveCodexProviderProfileOutput) -> Self {
Self(out.profile)
}
}
/// Request DTO for `save_claude_provider_profile` (ticket #99).
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SaveClaudeProviderProfileRequestDto {
pub profile: AgentProfile,
pub provider_id: String,
pub model: String,
pub api_key: String,
}
impl From<SaveClaudeProviderProfileRequestDto> for SaveClaudeProviderProfileInput {
fn from(dto: SaveClaudeProviderProfileRequestDto) -> Self {
Self {
profile: dto.profile,
provider_id: dto.provider_id,
model: dto.model,
api_key: dto.api_key,
}
}
}
impl From<SaveClaudeProviderProfileOutput> for ProfileDto {
fn from(out: SaveClaudeProviderProfileOutput) -> Self {
Self(out.profile)
}
}
/// Request DTO for `clone_opencode_profile_from_seed`.
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]