feat(frontend): support des providers OpenCode cloud (#92)

Ajoute l'UI de configuration des providers OpenCode cloud dans le wizard
first-run (sélection, édition, sauvegarde, suppression), le domaine et
les ports associés, ainsi que les adapters HTTP/mock correspondants.

Build + 952 tests verts, comportements clés vérifiés en exécution réelle,
y compris un test de couverture ajouté pour le parcours d'édition.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 08:18:02 +02:00
parent 23a3c2788f
commit c181b43d04
8 changed files with 649 additions and 6 deletions

View File

@ -999,6 +999,38 @@ export interface OpenCodeConfig {
localModelServerId?: string;
}
/**
* Configuration for an OpenCode profile backed by a **cloud** provider from the
* OpenCode registry (Anthropic, OpenRouter, …), as opposed to the custom
* `llamacpp` provider of {@link OpenCodeConfig}. Mirror of the backend
* `OpenCodeProviderConfig` (camelCase wire format). `apiKeyRef` is an opaque
* reference into the backend `SecretStore` — never the literal key, which is
* only ever sent (never read back) via
* {@link ProfileGateway.saveOpenCodeProviderProfile}.
*/
export interface OpenCodeProviderConfig {
/** Provider id in the OpenCode registry (e.g. `"anthropic"`). */
providerId: string;
/** Model name served by this provider. */
model: string;
/** Opaque reference to the sealed API key; never the literal key. */
apiKeyRef: string;
}
/**
* One entry of the static OpenCode cloud-provider catalogue (mirror of the
* backend `OpenCodeProviderDto`), returned by
* {@link ProfileGateway.listOpenCodeProviders}.
*/
export interface OpenCodeProviderCatalogEntry {
/** Provider id in the OpenCode registry (e.g. `"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.
@ -1029,6 +1061,12 @@ export interface AgentProfile {
chatHttp?: HttpChatConfig;
/** OpenCode process-backed config. Present for `structuredAdapter: "openCode"`. */
opencode?: OpenCodeConfig;
/**
* OpenCode **cloud** provider config (ticket #92). Mutually exclusive with
* {@link opencode}: a profile is either local (`llamacpp`) or cloud, never
* both.
*/
opencodeProvider?: OpenCodeProviderConfig;
}
/** Availability of a candidate profile after detection (mirror of the DTO). */