feat(model-server): frontend modèles locaux — badge de statut & CRUD serveurs (#35) et wizard multi-profils OpenCode (#36)

Sprint « Modeles locaux », couche frontend.

#35 :
- F35.1 badge de statut de lancement du serveur local
  (ModelServerLaunchBadge + useAgentsModelServer).
- F35.2 feature model-servers : CRUD (ModelServersPanel / useModelServers /
  gateway modelServer) et ModelServerSelect.

#36 :
- Liste multi-profils OpenCode dans le wizard de premier lancement,
  gateway de clonage (clone_opencode_profile_from_seed).

Tests verts (exécution réelle) : tsc propre, vitest 608/608.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 15:50:18 +02:00
parent b82ac76f8b
commit 72476a650a
23 changed files with 1893 additions and 15 deletions

View File

@ -25,10 +25,12 @@ import type {
LayoutList,
LayoutOperation,
LayoutTree,
LocalModelServerConfig,
Memory,
MemoryIndexEntry,
MemoryLink,
MemoryType,
OpenCodeConfig,
EffectivePermissions,
PermissionSet,
PageDirection,
@ -624,6 +626,45 @@ export interface ProfileGateway {
deleteProfile(profileId: string): Promise<void>;
/** Persists the batch of chosen profiles, closing the first run. */
configureProfiles(profiles: AgentProfile[]): Promise<AgentProfile[]>;
/**
* Mints a new OpenCode profile from the canonical `opencode-llamacpp` seed
* (F36 — several local OpenCode profiles per project, identity = id). `name`
* overrides the seed display name; `opencode` overrides the seed config (used
* by "Duplicate" to carry an existing row's endpoint). Returns the new,
* freshly-id'd profile — it is not persisted until the batch is saved.
*/
cloneOpenCodeProfileFromSeed(
input?: CloneOpenCodeProfileFromSeedInput,
): Promise<AgentProfile>;
}
/** Input for {@link ProfileGateway.cloneOpenCodeProfileFromSeed}. */
export interface CloneOpenCodeProfileFromSeedInput {
/** Optional display name for the new profile. */
name?: string;
/** Optional OpenCode config override; when omitted, the seed config is copied. */
opencode?: OpenCodeConfig;
}
/**
* Local model servers (F35). CRUD over the global registry of declared
* `llama.cpp` servers an OpenCode profile can bind to via
* `OpenCodeConfig.localModelServerId`. Mirrors the three backend commands
* (`list_model_servers`, `save_model_server`, `delete_model_server`).
*/
export interface ModelServerGateway {
/** Lists the declared local model servers. */
listModelServers(): Promise<LocalModelServerConfig[]>;
/**
* Upserts a server config (create when `id` is a fresh client-minted UUID,
* update otherwise); returns the persisted config.
*/
saveModelServer(config: LocalModelServerConfig): Promise<LocalModelServerConfig>;
/**
* Deletes a server by id. Rejects with a `GatewayError` whose `code` is
* `model_server_in_use` when a profile still references it.
*/
deleteModelServer(serverId: string): Promise<void>;
}
/** Input for {@link EmbedderGateway.saveEmbedderProfile}. */
@ -933,6 +974,7 @@ export interface Gateways {
git: GitGateway;
remote: RemoteGateway;
profile: ProfileGateway;
modelServer: ModelServerGateway;
template: TemplateGateway;
skill: SkillGateway;
memory: MemoryGateway;