Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion runtimes/basic/core_py/thinui/api.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -318,7 +318,6 @@ def run_api_server(host: str = "127.0.0.1", port: int = 8001):
print(f" GET http://{host}:{port}/api/udo/workflows")
print(f" GET http://{host}:{port}/api/udo/publish/targets")
print(f" GET http://{host}:{port}/api/udo/vault")
print(f" GET http://{host}:{port}/api/udo/mcp/status")
print(f" GET http://{host}:{port}/api/udo/checks")
print(f" POST http://{host}:{port}/api/udo/exec")

Expand Down
4 changes: 1 addition & 3 deletions runtimes/basic/core_py/udo_runtime/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,12 +9,10 @@
- Workflows: Multi-step orchestration
- Publish: Content publishing to targets
- Vault: File system abstraction
- MCP: Model Context Protocol server management
- Checks: System health checks
- Exec: Command execution

This module is the Python reference implementation.
A Rust-native version will be built for Snackbar production deployment.
This module is the Python runtime implementation.
"""

__version__ = "0.1.0"
Expand Down
34 changes: 0 additions & 34 deletions runtimes/basic/core_py/udo_runtime/api.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -235,40 +235,6 @@ def write_vault():
success = rt.write_vault_file(data["path"], data.get("content", ""))
return jsonify({"success": success})

# ─── MCP ───────────────────────────────────────────────────────

@bp.route("/mcp/status", methods=["GET"])
def mcp_status():
servers = rt.get_mcp_status()
return jsonify([{
"id": s.id,
"name": s.name,
"running": s.running,
"output": s.output,
"error": s.error,
"startedAt": s.started_at,
} for s in servers])

@bp.route("/mcp/<server_id>/start", methods=["POST"])
def start_mcp(server_id: str):
success = rt.start_mcp_server(server_id)
return jsonify({"success": success})

@bp.route("/mcp/<server_id>/stop", methods=["POST"])
def stop_mcp(server_id: str):
success = rt.stop_mcp_server(server_id)
return jsonify({"success": success})

@bp.route("/mcp/<server_id>/call", methods=["POST"])
def call_mcp(server_id: str):
data = request.get_json() or {}
result = rt.call_mcp_tool(
server_id,
data.get("tool", ""),
data.get("args", {}),
)
return jsonify(result)

# ─── Checks ────────────────────────────────────────────────────

@bp.route("/checks", methods=["GET"])
Expand Down
40 changes: 0 additions & 40 deletions runtimes/basic/core_py/udo_runtime/runtime.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,16 +75,6 @@ class UDOPublishTarget:
status: str = "disconnected" # 'connected' | 'disconnected' | 'error'


@dataclass
class MCPServerStatus:
id: str
name: str
running: bool = False
output: List[str] = field(default_factory=list)
error: Optional[str] = None
started_at: Optional[int] = None


@dataclass
class CheckResult:
id: str
Expand DownExpand Up@@ -117,7 +107,6 @@ def __init__(self, data_dir: Optional[str] = None):
self.agents: Dict[str, UDOAgent] = {}
self.workflows: Dict[str, UDOWorkflow] = {}
self.publish_targets: Dict[str, UDOPublishTarget] = {}
self.mcp_servers: Dict[str, MCPServerStatus] = {}
self.checks: Dict[str, CheckResult] = {}

# Load persisted state
Expand DownExpand Up@@ -149,7 +138,6 @@ def _load_state(self):
("agents", UDOAgent),
("workflows", UDOWorkflow),
("publish_targets", UDOPublishTarget),
("mcp_servers", MCPServerStatus),
("checks", CheckResult),
]:
items = self._load_state_file(key)
Expand DownExpand Up@@ -411,34 +399,6 @@ def write_vault_file(self, path: str, content: str) -> bool:
target.write_text(content)
return True

# ─── MCP ───────────────────────────────────────────────────────

def get_mcp_status(self) -> List[MCPServerStatus]:
return list(self.mcp_servers.values())

def start_mcp_server(self, server_id: str) -> bool:
if server_id in self.mcp_servers:
self.mcp_servers[server_id].running = True
self.mcp_servers[server_id].started_at = int(time.time())
self._persist("mcp_servers")
return True
return False

def stop_mcp_server(self, server_id: str) -> bool:
if server_id in self.mcp_servers:
self.mcp_servers[server_id].running = False
self._persist("mcp_servers")
return True
return False

def call_mcp_tool(self, server_id: str, tool: str, args: Dict[str, Any]) -> Any:
if server_id not in self.mcp_servers:
return {"error": f"MCP server {server_id} not found"}
if not self.mcp_servers[server_id].running:
return {"error": f"MCP server {server_id} is not running"}
# Placeholder: actual MCP tool call
return {"result": f"Called {tool} on {server_id} with {args}"}

# ─── Checks ────────────────────────────────────────────────────

def list_checks(self) -> List[CheckResult]:
Expand Down
Loading