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

@ -1068,36 +1068,6 @@ export interface OpenCodeProviderConfig {
custom?: CustomProviderConfig;
}
/**
* Configuration for a Codex profile backed by a provider/model pair (ticket
* #99). `apiKeyRef` is an opaque backend SecretStore reference; the literal
* secret is only sent through {@link ProfileGateway.saveCodexProviderProfile}.
*/
export interface CodexProviderConfig {
/** Provider id used as Codex's `model_provider` (e.g. `"openai"`). */
providerId: string;
/** Model name written into Codex's isolated config. */
model: string;
/** Opaque reference to the sealed API key; never the literal key. */
apiKeyRef: string;
/** Optional custom OpenAI-compatible endpoint for this Codex provider. */
custom?: CodexCustomProviderConfig;
}
/**
* Configuration for a Claude profile backed by a provider/model pair (ticket
* #99). `apiKeyRef` is an opaque backend SecretStore reference; the literal
* secret is only sent through {@link ProfileGateway.saveClaudeProviderProfile}.
*/
export interface ClaudeProviderConfig {
/** Provider id. V1 backend exposes `"anthropic"`. */
providerId: string;
/** Model name written into Claude's isolated settings. */
model: string;
/** Opaque reference to the sealed API key; never the literal key. */
apiKeyRef: string;
}
/**
* Config for a custom OpenCode provider (mirror of the backend
* `CustomProviderConfig`, camelCase wire format), carried by
@ -1112,18 +1082,6 @@ export interface CustomProviderConfig {
displayName?: string;
}
/**
* Config for a custom Codex provider (mirror of the backend
* `CodexCustomProviderConfig`, camelCase wire format), carried by
* {@link CodexProviderConfig.custom}.
*/
export interface CodexCustomProviderConfig {
/** Base URL of the OpenAI-compatible endpoint. */
baseUrl: string;
/** Optional display label written into Codex's provider table. */
displayName?: string;
}
/**
* One entry of the static OpenCode cloud-provider catalogue (mirror of the
* backend `OpenCodeProviderDto`), returned by
@ -1138,28 +1096,6 @@ export interface OpenCodeProviderCatalogEntry {
models: string[];
}
/** One entry of the static Codex provider catalogue (ticket #99). */
export interface CodexProviderCatalogEntry {
/** Provider id used as Codex's `model_provider`. */
providerId: string;
/** Human-readable label for the picker UI. */
displayName: string;
/** Model names this provider serves, offered for selection. */
models: string[];
/** Whether this provider supports a custom endpoint in the UI. */
customSupported: boolean;
}
/** One entry of the static Claude provider catalogue (ticket #99). */
export interface ClaudeProviderCatalogEntry {
/** Provider id. V1 backend exposes `"anthropic"`. */
providerId: string;
/** Human-readable label for the picker UI. */
displayName: string;
/** Model names this provider serves, offered for selection. */
models: string[];
}
/**
* A declarative AI-CLI profile (mirror of the backend `AgentProfile`). `id` is a
* UUID string; `detect` is the optional detection command line.
@ -1196,10 +1132,11 @@ export interface AgentProfile {
* both.
*/
opencodeProvider?: OpenCodeProviderConfig;
/** Codex provider/model config (ticket #99). */
codexProvider?: CodexProviderConfig;
/** Claude provider/model config (ticket #99). */
claudeProvider?: ClaudeProviderConfig;
/**
* Optional direct CLI model setting for Codex/Claude. `undefined` keeps the
* CLI's own default. OpenCode keeps its dedicated provider/local model fields.
*/
model?: string;
}
/** Availability of a candidate profile after detection (mirror of the DTO). */