Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai>
Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com>
Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Val <102326092+vdeva@users.noreply.github.com>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Guillaume LE GOFF 2026-06-12 13:16:04 +02:00 committed by GitHub
parent 702d0f412e
commit cafb6d4147
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
247 changed files with 12401 additions and 3029 deletions

View file

@ -2,11 +2,15 @@ from __future__ import annotations
from pathlib import Path
import tomllib
from typing import Any
from vibe.core.config.fingerprint import capture_stable_file
from vibe.core.config.layer import ConfigLayer, RawConfig
from vibe.core.config.patch import ConfigPatch
from vibe.core.config.types import ConflictStrategy
from vibe.core.config.types import (
EMPTY_CONFIG_SNAPSHOT,
ConflictStrategy,
LayerConfigSnapshot,
)
from vibe.core.paths._vibe_home import VIBE_HOME
@ -24,11 +28,14 @@ class UserConfigLayer(ConfigLayer[RawConfig]):
async def _check_trust(self) -> bool:
return True
async def _read_config(self) -> dict[str, Any]:
async def _build_config_snapshot(self) -> LayerConfigSnapshot:
if not self._path.exists():
return {}
with self._path.open("rb") as f:
return tomllib.load(f)
return EMPTY_CONFIG_SNAPSHOT
with capture_stable_file(self._path) as (file, fingerprint):
data = tomllib.load(file)
return LayerConfigSnapshot(data=data, fingerprint=fingerprint)
async def apply(
self,