Co-authored-by: Quentin Torroba <quentin.torroba@mistral.ai> Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai> Co-authored-by: Vincent Guilloux <vincent.guilloux@mistral.ai> Co-authored-by: Clement Sirieix <clem.sirieix@gmail.com> Co-authored-by: Antoine W <antoine.wronka@mistral.ai> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
41 lines
1.4 KiB
Python
41 lines
1.4 KiB
Python
from __future__ import annotations
|
|
|
|
from collections.abc import Callable
|
|
import os
|
|
from pathlib import Path
|
|
|
|
from vibe import VIBE_ROOT
|
|
|
|
|
|
class GlobalPath:
|
|
def __init__(self, resolver: Callable[[], Path]) -> None:
|
|
self._resolver = resolver
|
|
|
|
@property
|
|
def path(self) -> Path:
|
|
return self._resolver()
|
|
|
|
|
|
_DEFAULT_VIBE_HOME = Path.home() / ".vibe"
|
|
|
|
|
|
def _get_vibe_home() -> Path:
|
|
if vibe_home := os.getenv("VIBE_HOME"):
|
|
return Path(vibe_home).expanduser().resolve()
|
|
return _DEFAULT_VIBE_HOME
|
|
|
|
|
|
VIBE_HOME = GlobalPath(_get_vibe_home)
|
|
GLOBAL_CONFIG_FILE = GlobalPath(lambda: VIBE_HOME.path / "config.toml")
|
|
GLOBAL_ENV_FILE = GlobalPath(lambda: VIBE_HOME.path / ".env")
|
|
GLOBAL_TOOLS_DIR = GlobalPath(lambda: VIBE_HOME.path / "tools")
|
|
GLOBAL_SKILLS_DIR = GlobalPath(lambda: VIBE_HOME.path / "skills")
|
|
GLOBAL_AGENTS_DIR = GlobalPath(lambda: VIBE_HOME.path / "agents")
|
|
GLOBAL_PROMPTS_DIR = GlobalPath(lambda: VIBE_HOME.path / "prompts")
|
|
SESSION_LOG_DIR = GlobalPath(lambda: VIBE_HOME.path / "logs" / "session")
|
|
TRUSTED_FOLDERS_FILE = GlobalPath(lambda: VIBE_HOME.path / "trusted_folders.toml")
|
|
LOG_DIR = GlobalPath(lambda: VIBE_HOME.path / "logs")
|
|
LOG_FILE = GlobalPath(lambda: VIBE_HOME.path / "logs" / "vibe.log")
|
|
PLANS_DIR = GlobalPath(lambda: VIBE_HOME.path / "plans")
|
|
|
|
DEFAULT_TOOL_DIR = GlobalPath(lambda: VIBE_ROOT / "core" / "tools" / "builtins")
|