feat(opencode): remplace le profil Ollama HTTP par OpenCode

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-09 15:48:07 +02:00
parent 2fa226e413
commit eaba05d27d
19 changed files with 734 additions and 45 deletions

View File

@ -631,12 +631,12 @@ export type InjectionStrategy = ContextInjection["strategy"];
* `StructuredAdapter`, camelCase wire format). Absent (`structuredAdapter`
* omitted) ⇒ the profile is a plain TUI/PTY agent (historical behaviour);
* present ⇒ the profile is selectable as a structured AI agent:
* - `claude` / `codex`: driven by a spawned CLI binary,
* - `claude` / `codex` / `openCode`: driven by a spawned CLI binary,
* - `openAiCompatible`: driven by IdeA's native HTTP adapter against an
* OpenAI-compatible chat server (Ollama, llama.cpp, a LAN runtime) — see
* {@link HttpChatConfig}.
*/
export type StructuredAdapter = "claude" | "codex" | "openAiCompatible";
export type StructuredAdapter = "claude" | "codex" | "openCode" | "openAiCompatible";
/**
* HTTP configuration of an OpenAI-compatible chat server (mirror of the backend
@ -662,6 +662,12 @@ export interface HttpChatConfig {
maxToolIterations?: number;
}
/** Configuration for an OpenCode process-backed profile. */
export interface OpenCodeConfig {
/** Full OpenCode model id, for example `ollama/qwen3-coder:30b`. */
model?: string;
}
/**
* A declarative AI-CLI profile (mirror of the backend `AgentProfile`). `id` is a
* UUID string; `detect` is the optional detection command line.
@ -690,6 +696,8 @@ export interface AgentProfile {
* every historical profile and every non-HTTP adapter.
*/
chatHttp?: HttpChatConfig;
/** OpenCode process-backed config. Present for `structuredAdapter: "openCode"`. */
opencode?: OpenCodeConfig;
}
/** Availability of a candidate profile after detection (mirror of the DTO). */

View File

@ -125,6 +125,9 @@ export function validateProfile(p: AgentProfile): ProfileErrors {
Object.assign(errors, validateHttpChatConfig(p.chatHttp));
}
}
if (p.structuredAdapter === "openCode" && p.opencode?.model !== undefined) {
if (p.opencode.model.trim().length === 0) errors.model = "Model is required.";
}
return errors;
}