feat(memory): config embedders (LOT C2) + suggestion contextuelle (LOT C3) + contexte projet partagé

- LOT C2 (§14.5.3) : use cases de configuration des embedders déclaratifs
  (List/Save/Delete + DescribeEmbedderEngines : modèles ONNX recommandés,
  environnement local détecté, stratégies compilées). UI EmbedderSettings.
- LOT C3 (§14.5.5) : suggestion contextuelle best-effort à l'activation quand la
  mémoire dépasse le budget de recall sans embedder configuré (event
  EmbedderSuggested, anti-spam 1×/session, « ne plus demander »).
- Contexte projet partagé .ideai/CONTEXT.md (model-agnostic) injecté à tous les
  agents/profils au lancement, avant la persona. UI ProjectContextPanel.

Tests : backend workspace vert (0 échec) ; frontend 306/306.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 09:24:51 +02:00
parent 32398827fb
commit 785e9935fd
118 changed files with 5793 additions and 866 deletions

View File

@ -70,8 +70,7 @@ impl CliAgentRuntime {
let args = tokens.map(str::to_owned).collect();
// Detection runs in a neutral cwd; "." is a safe relative placeholder the
// spawner resolves against the process cwd.
let cwd = ProjectPath::new("/")
.map_err(|e| RuntimeError::Detection(e.to_string()))?;
let cwd = ProjectPath::new("/").map_err(|e| RuntimeError::Detection(e.to_string()))?;
Ok(SpawnSpec {
command,
args,
@ -90,7 +89,10 @@ impl CliAgentRuntime {
/// `{projectRoot}` is still substituted with the same base for backwards
/// compatibility (the caller always passes the run dir now). An empty template
/// defaults to the base itself.
fn resolve_cwd(profile: &AgentProfile, base: &ProjectPath) -> Result<ProjectPath, RuntimeError> {
fn resolve_cwd(
profile: &AgentProfile,
base: &ProjectPath,
) -> Result<ProjectPath, RuntimeError> {
let template = profile.cwd_template.trim();
if template.is_empty() {
return Ok(base.clone());
@ -117,10 +119,7 @@ impl CliAgentRuntime {
/// (e.g. `-f` → `["-f", "<path>"]`); a flag *with* `{path}` is split on
/// whitespace after substitution (e.g. `--context-file {path}` →
/// `["--context-file", "<path>"]`).
fn injection_plan(
injection: &ContextInjection,
ctx: &PreparedContext,
) -> ContextInjectionPlan {
fn injection_plan(injection: &ContextInjection, ctx: &PreparedContext) -> ContextInjectionPlan {
match injection {
ContextInjection::ConventionFile { target } => ContextInjectionPlan::File {
target: target.clone(),