refactor: split config.py into the beaver_agent package (vault, prompts, skills, policy, hands, agents, frontends, texts, memory, jobs)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""Календари из `CALENDAR_MCPS=name=url,name=url`; в url - приватный фид с токеном."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from beaver_gateway.mcp.types import HttpMcp, McpServer
|
||||
|
||||
|
||||
def calendars(raw: str) -> list[HttpMcp]:
|
||||
servers: list[HttpMcp] = []
|
||||
for position, raw_entry in enumerate(raw.split(","), start=1):
|
||||
entry = raw_entry.strip()
|
||||
if not entry:
|
||||
continue
|
||||
name, sep, url = entry.partition("=")
|
||||
if not sep or not url.strip():
|
||||
msg = f"CALENDAR_MCPS: запись #{position} не вида `name=url`"
|
||||
raise ValueError(msg)
|
||||
servers.append(McpServer.http(name=f"calendar-{name.strip()}", url=url.strip()))
|
||||
return servers
|
||||
Reference in New Issue
Block a user