agent-zero/plugins/_orchestrator/api/disconnect.py
Alessandro f64b6490c5 Add bundled Orchestrator plugin
Promote the terminal agent work into the built-in plugins tree as _orchestrator with Orchestrator branding and the orchestrator skill.

Include adapter status APIs, settings UI, per-agent skill references, thumbnail asset, tests, and DOX coverage for the bundled plugin.
2026-07-09 13:18:44 +02:00

21 lines
794 B
Python

from __future__ import annotations
from helpers.api import ApiHandler, Request
from helpers.plugins import get_plugin_config
from plugins._orchestrator.helpers.registry import adapter_config, get_adapter
PLUGIN_NAME = "_orchestrator"
class Disconnect(ApiHandler):
async def process(self, input: dict, request: Request) -> dict:
agent_id = str(input.get("agent_id") or "codex")
try:
adapter = get_adapter(agent_id)
plugin_config = get_plugin_config(PLUGIN_NAME) or {}
cfg = adapter_config(adapter.id, plugin_config)
result = adapter.disconnect(cfg)
return {"ok": True, "agent_id": adapter.id, **result}
except Exception as exc:
return {"ok": False, "agent_id": agent_id, "error": str(exc)}