mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-18 06:11:12 +00:00
Introduce the builtin `_a0_connector` plugin that lets the host-side A0 CLI connect to Agent Zero over authenticated HTTP and `/ws`. This adds connector capability discovery, chat/context lifecycle endpoints, log streaming, and the remote text editing, code execution, and file tree bridge used by the CLI workflow.
22 lines
816 B
Python
22 lines
816 B
Python
"""POST /api/plugins/_a0_connector/v1/settings_set."""
|
|
from __future__ import annotations
|
|
|
|
from helpers.api import Request, Response
|
|
import plugins._a0_connector.api.v1.base as connector_base
|
|
|
|
|
|
class SettingsSet(connector_base.ProtectedConnectorApiHandler):
|
|
async def process(self, input: dict, request: Request) -> dict | Response:
|
|
from helpers import settings
|
|
|
|
payload = input.get("settings", input)
|
|
if not isinstance(payload, dict):
|
|
return Response(
|
|
response='{"error":"settings must be an object"}',
|
|
status=400,
|
|
mimetype="application/json",
|
|
)
|
|
|
|
backend = settings.convert_in(settings.Settings(**payload))
|
|
backend = settings.set_settings(backend)
|
|
return dict(settings.convert_out(backend))
|