feat(frontend): provider OpenCode dynamique + saisie provider personnalisé (#92)

Le picker de provider OpenCode du first-run wizard consomme le
catalogue dynamique exposé par le backend et propose une option
« provider personnalisé » avec un formulaire de saisie libre
(id + clé API) quand le provider souhaité n'y figure pas.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 12:44:02 +02:00
parent e943a0efed
commit 1784027f5d
7 changed files with 470 additions and 69 deletions

View File

@ -1015,6 +1015,26 @@ export interface OpenCodeProviderConfig {
model: string;
/** Opaque reference to the sealed API key; never the literal key. */
apiKeyRef: string;
/**
* Additive config for a **custom** provider (endpoint outside the OpenCode
* registry, ticket #92). Absent = known catalogue provider (unchanged
* behaviour); present = arbitrary OpenAI-compatible endpoint.
*/
custom?: CustomProviderConfig;
}
/**
* Config for a custom OpenCode provider (mirror of the backend
* `CustomProviderConfig`, camelCase wire format), carried by
* {@link OpenCodeProviderConfig.custom}.
*/
export interface CustomProviderConfig {
/** AI SDK npm package used to talk to this provider (e.g. `"@ai-sdk/openai-compatible"`). */
npm: string;
/** Base URL of the OpenAI-compatible endpoint. */
baseUrl: string;
/** Optional display label for the model (defaults to the model id). */
displayName?: string;
}
/**