mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-29 10:43:34 +00:00
Add Download to Editor file actions and safe File Browser extraction for ZIP, TAR, RAR, 7z, and compressed archives. Include archive safety checks, focused regressions, and 7zip in the base image.
908 B
908 B
extract_work_dir_archive.py DOX
Purpose
- Own the authenticated, CSRF-protected archive extraction endpoint for File Browser.
- Extract supported archives into a new sibling folder without overwriting existing content.
Ownership
ExtractWorkDirArchivereceives a filepathand optional listingcurrentPath.extract_archivevalidates the source, creates the destination, and removes partial output on failure.
Runtime Contracts
- ZIP and TAR-family archives use the Python standard library; RAR, 7z, and single-file compression formats use the image
7zipbinary. - Archive members must remain below the new destination and cannot be links or devices.
- Successful extraction emits
workdir_file_mutation_afterand returns a refreshed file listing plusextracted_path.
Verification
- Run
pytest tests/test_file_browser_archives.py tests/test_file_browser_navigation.py.