Add Claude Desktop configuration via skyvern run mcp (#2045)

This commit is contained in:
Jose
2025-04-02 10:33:37 -06:00
committed by GitHub
parent b2ae3f999c
commit d168da4653
5 changed files with 799 additions and 56 deletions

View File

@@ -1,3 +1,8 @@
import platform
import subprocess
from pathlib import Path
from typing import Optional
from alembic import command
from alembic.config import Config
from skyvern.constants import REPO_ROOT_DIR
@@ -8,3 +13,50 @@ def migrate_db() -> None:
path = f"{REPO_ROOT_DIR}/alembic"
alembic_cfg.set_main_option("script_location", path)
command.upgrade(alembic_cfg, "head")
def detect_os() -> str:
"""
Detects the operating system.
Returns:
str: The name of the OS in lowercase.
Returns 'wsl' for Windows Subsystem for Linux,
'linux' for native Linux,
or the lowercase name of other platforms (e.g., 'windows', 'darwin').
"""
system = platform.system()
if system == "Linux":
try:
with open("/proc/version", "r") as f:
version_info = f.read().lower()
if "microsoft" in version_info:
return "wsl"
except Exception:
pass
return "linux"
else:
return system.lower()
def get_windows_appdata_roaming() -> Optional[Path]:
"""
Retrieves the Windows 'AppData\\Roaming' directory path from WSL.
Returns:
Optional[Path]: A Path object representing the translated Linux-style path
to the Windows AppData\\Roaming folder, or None if retrieval fails.
"""
try:
output = (
subprocess.check_output(
["powershell.exe", "-NoProfile", "-Command", "[Environment]::GetFolderPath('ApplicationData')"],
stderr=subprocess.DEVNULL,
)
.decode("utf-8")
.strip()
)
linux_path = "/mnt/" + output[0].lower() + output[2:].replace("\\", "/")
return Path(linux_path)
except Exception:
return None