mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-12-04 09:28:56 +00:00
Move tunnel, browser, document, speech and integration runtimes into plugin-owned sandboxes with lazy dependencies and instance-scoped lifecycle management. Reuse Tuxee display assets and the sandbox image's Python/Node runtimes, enable automatic Desktop login, and show elapsed time for each browser launch. Slim the outer image, use offline ONNX embeddings, and calculate sandbox storage only on demand. Include regression coverage and updated runtime documentation. Exclude local handoff notes and temporary verification artifacts from publication.
18 lines
657 B
Python
18 lines
657 B
Python
import asyncio
|
|
from helpers.api import ApiHandler, Request
|
|
from plugins._desktop.helpers import runtime
|
|
|
|
|
|
class DesktopSession(ApiHandler):
|
|
async def process(self, input: dict, request: Request) -> dict:
|
|
action = str(input.get('action') or 'desktop')
|
|
if action == 'status':
|
|
return runtime.status()
|
|
if action in {'desktop', 'open', 'session'}:
|
|
await asyncio.to_thread(runtime.start)
|
|
return runtime.status()
|
|
if action == 'shutdown':
|
|
await asyncio.to_thread(runtime.stop)
|
|
return runtime.status()
|
|
return {'ok': False, 'error': 'Unsupported Desktop action'}
|