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:
@ -9,8 +9,6 @@ import type {
|
||||
AgentDrift,
|
||||
AppExitWorkGuardState,
|
||||
AgentProfile,
|
||||
ClaudeProviderCatalogEntry,
|
||||
CodexProviderCatalogEntry,
|
||||
DiagnosticWarning,
|
||||
DomainEvent,
|
||||
EmbedderEngines,
|
||||
@ -105,8 +103,6 @@ import type {
|
||||
ReattachResult,
|
||||
RemoteGateway,
|
||||
ReviewPluginPackageInput,
|
||||
SaveClaudeProviderProfileInput,
|
||||
SaveCodexProviderProfileInput,
|
||||
SaveOpenCodeProviderProfileInput,
|
||||
SkillGateway,
|
||||
StoppedLiveAgent,
|
||||
@ -1297,25 +1293,6 @@ const MOCK_OPENCODE_PROVIDERS: OpenCodeProviderCatalogEntry[] = [
|
||||
},
|
||||
];
|
||||
|
||||
/** Static mock catalogue mirroring the backend Codex provider list. */
|
||||
const MOCK_CODEX_PROVIDERS: CodexProviderCatalogEntry[] = [
|
||||
{
|
||||
providerId: "openai",
|
||||
displayName: "OpenAI",
|
||||
models: ["gpt-5", "gpt-5-mini", "gpt-5-codex", "o3"],
|
||||
customSupported: true,
|
||||
},
|
||||
];
|
||||
|
||||
/** Static mock catalogue mirroring the backend Claude provider list. */
|
||||
const MOCK_CLAUDE_PROVIDERS: ClaudeProviderCatalogEntry[] = [
|
||||
{
|
||||
providerId: "anthropic",
|
||||
displayName: "Anthropic",
|
||||
models: ["claude-sonnet-4-5", "claude-opus-4-1", "claude-haiku-3-5"],
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* In-memory profiles gateway. Tracks configured profiles and a first-run flag so
|
||||
* the wizard can be driven and tested fully offline. By default it reports the
|
||||
@ -1412,52 +1389,6 @@ export class MockProfileGateway implements ProfileGateway {
|
||||
return structuredClone(saved);
|
||||
}
|
||||
|
||||
async listCodexProviders(): Promise<CodexProviderCatalogEntry[]> {
|
||||
return structuredClone(MOCK_CODEX_PROVIDERS);
|
||||
}
|
||||
|
||||
async saveCodexProviderProfile(
|
||||
input: SaveCodexProviderProfileInput,
|
||||
): Promise<AgentProfile> {
|
||||
const saved: AgentProfile = {
|
||||
...structuredClone(input.profile),
|
||||
codexProvider: {
|
||||
providerId: input.providerId,
|
||||
model: input.model,
|
||||
apiKeyRef:
|
||||
input.profile.codexProvider?.apiKeyRef ?? `mock-secret-${input.profile.id}`,
|
||||
custom: input.custom,
|
||||
},
|
||||
};
|
||||
const i = this.profiles.findIndex((p) => p.id === saved.id);
|
||||
if (i >= 0) this.profiles[i] = saved;
|
||||
else this.profiles.push(saved);
|
||||
this.configured = true;
|
||||
return structuredClone(saved);
|
||||
}
|
||||
|
||||
async listClaudeProviders(): Promise<ClaudeProviderCatalogEntry[]> {
|
||||
return structuredClone(MOCK_CLAUDE_PROVIDERS);
|
||||
}
|
||||
|
||||
async saveClaudeProviderProfile(
|
||||
input: SaveClaudeProviderProfileInput,
|
||||
): Promise<AgentProfile> {
|
||||
const saved: AgentProfile = {
|
||||
...structuredClone(input.profile),
|
||||
claudeProvider: {
|
||||
providerId: input.providerId,
|
||||
model: input.model,
|
||||
apiKeyRef:
|
||||
input.profile.claudeProvider?.apiKeyRef ?? `mock-secret-${input.profile.id}`,
|
||||
},
|
||||
};
|
||||
const i = this.profiles.findIndex((p) => p.id === saved.id);
|
||||
if (i >= 0) this.profiles[i] = saved;
|
||||
else this.profiles.push(saved);
|
||||
this.configured = true;
|
||||
return structuredClone(saved);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user