mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-10 01:18:29 +00:00
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.
21 lines
794 B
Python
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)}
|