Co-authored-by: Carlo <carloantonio.patti@mistral.ai>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Clement Sirieix <clem.sirieix@gmail.com>
Co-authored-by: Michel Thomazo <michel.thomazo@mistral.ai>
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Vincent Guilloux <vincent.guilloux@mistral.ai>
Co-authored-by: Thomas Kenbeek <thomas.kenbeek@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Quentin 2026-02-27 17:31:58 +01:00 committed by GitHub
parent a560a47ce8
commit 5d2e01a6d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
139 changed files with 7152 additions and 1457 deletions

View file

@ -1,7 +1,6 @@
from __future__ import annotations
from collections.abc import Callable
from logging import getLogger
from pathlib import Path
from typing import TYPE_CHECKING
@ -11,15 +10,14 @@ from vibe.core.agents.models import (
AgentType,
BuiltinAgentName,
)
from vibe.core.paths.config_paths import resolve_local_agents_dir
from vibe.core.logger import logger
from vibe.core.paths.config_paths import discover_local_agents_dirs
from vibe.core.paths.global_paths import GLOBAL_AGENTS_DIR
from vibe.core.utils import name_matches
if TYPE_CHECKING:
from vibe.core.config import VibeConfig
logger = getLogger("vibe")
class AgentManager:
def __init__(
@ -77,6 +75,10 @@ class AgentManager:
self.active_profile = self.get_agent(name)
self._cached_config = None
def register_agent(self, profile: AgentProfile) -> None:
self._available[profile.name] = profile
self._cached_config = None
def invalidate_config(self) -> None:
self._cached_config = None
@ -86,8 +88,7 @@ class AgentManager:
for path in config.agent_paths:
if path.is_dir():
paths.append(path)
if (agents_dir := resolve_local_agents_dir(Path.cwd())) is not None:
paths.append(agents_dir)
paths.extend(discover_local_agents_dirs(Path.cwd()))
if GLOBAL_AGENTS_DIR.path.is_dir():
paths.append(GLOBAL_AGENTS_DIR.path)
unique: list[Path] = []

View file

@ -34,6 +34,7 @@ class AgentType(StrEnum):
class BuiltinAgentName(StrEnum):
DEFAULT = "default"
CHAT = "chat"
PLAN = "plan"
ACCEPT_EDITS = "accept-edits"
AUTO_APPROVE = "auto-approve"
@ -69,6 +70,7 @@ class AgentProfile:
)
CHAT_AGENT_TOOLS = ["grep", "read_file", "ask_user_question", "task"]
PLAN_AGENT_TOOLS = ["grep", "read_file", "todo", "ask_user_question", "task"]
DEFAULT = AgentProfile(
@ -84,6 +86,13 @@ PLAN = AgentProfile(
AgentSafety.SAFE,
overrides={"auto_approve": True, "enabled_tools": PLAN_AGENT_TOOLS},
)
CHAT = AgentProfile(
BuiltinAgentName.CHAT,
"Chat",
"Read-only conversational mode for questions and discussions",
AgentSafety.SAFE,
overrides={"auto_approve": True, "enabled_tools": CHAT_AGENT_TOOLS},
)
ACCEPT_EDITS = AgentProfile(
BuiltinAgentName.ACCEPT_EDITS,
"Accept Edits",