feat: implement raycast backend

This commit is contained in:
hh
2026-05-19 21:06:01 +02:00
parent 221e660c5c
commit 757065f21c
16 changed files with 1415 additions and 31 deletions
+9 -3
View File
@@ -7,6 +7,7 @@ discriminated-union members so downstream code can ``match`` on ``kind``.
from __future__ import annotations
from collections.abc import Callable # noqa: TC003 — runtime use by pydantic
from pathlib import Path
from typing import TYPE_CHECKING, Annotated, Literal
from pydantic import BaseModel, ConfigDict, Field
@@ -27,7 +28,7 @@ class StdioMcp(_BaseMcp):
kind: Literal["stdio"] = "stdio"
command: tuple[str, ...]
env: dict[str, str] | None = None
cwd: str | None = None
cwd: Path | None = None
class HttpMcp(_BaseMcp):
@@ -60,9 +61,14 @@ class McpServer:
name: str,
command: Iterable[str],
env: dict[str, str] | None = None,
cwd: str | None = None,
cwd: Path | str | None = None,
) -> StdioMcp:
return StdioMcp(name=name, command=tuple(command), env=env, cwd=cwd)
return StdioMcp(
name=name,
command=tuple(command),
env=env,
cwd=Path(cwd) if isinstance(cwd, str) else cwd,
)
@classmethod
def http(