Files
agent-zero/api/extract_work_dir_archive.py
Jan Tomášek 188cff2073 Move optional runtimes into persistent gVisor plugin sandboxes
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.
2026-11-08 21:43:22 +01:00

37 lines
1.2 KiB
Python

from __future__ import annotations
from helpers import extension
from helpers.api import ApiHandler, Input, Output, Request
from api import get_work_dir_files
from helpers.file_archives import extract_archive
class ExtractWorkDirArchive(ApiHandler):
async def process(self, input: Input, request: Request) -> Output:
path = str(input.get("path") or "").strip()
if not path:
return {"error": "Archive path is required"}
if not path.startswith("/"):
path = f"/{path}"
try:
extracted_path = extract_archive(path)
except (OSError, ValueError) as exc:
return {"error": str(exc)}
current_path = str(input.get("currentPath") or "")
await extension.call_extensions_async(
"workdir_file_mutation_after",
agent=None,
data={
"action": "extract",
"path": extracted_path,
"paths": [path, extracted_path],
"current_path": current_path,
},
)
listing = await get_work_dir_files.get_files(current_path)
return {"data": listing, "extracted_path": extracted_path}