mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-09 17:08:29 +00:00
Add Files to the universal canvas rail and sidebar flow, with a reusable floating surface modal chrome that matches Browser/Desktop behavior. Make the File Browser modal draggable/resizable with Focus mode, keep Editor on the same draggable modal helper, and preserve dock/undock handoff state. Harden File Browser startup so empty paths resolve to the default workdir, restyle the Up control, compact New file/New folder actions, and hide Modified before Name/Size in narrow containers. Update DOX contracts and focused regression coverage for the new Files surface, modal chrome, default-path fallback, and compact layout behavior.
29 lines
897 B
Python
29 lines
897 B
Python
from helpers.api import ApiHandler, Request, Response
|
|
from helpers.file_browser import FileBrowser
|
|
from helpers import runtime, files
|
|
|
|
class GetWorkDirFiles(ApiHandler):
|
|
|
|
@classmethod
|
|
def get_methods(cls):
|
|
return ["GET"]
|
|
|
|
async def process(self, input: dict, request: Request) -> dict | Response:
|
|
current_path = request.args.get("path", "") or "$WORK_DIR"
|
|
if current_path == "$WORK_DIR":
|
|
# if runtime.is_development():
|
|
# current_path = "work_dir"
|
|
# else:
|
|
# current_path = "root"
|
|
current_path = "/a0"
|
|
|
|
# browser = FileBrowser()
|
|
# result = browser.get_files(current_path)
|
|
result = await runtime.call_development_function(get_files, current_path)
|
|
|
|
return {"data": result}
|
|
|
|
|
|
async def get_files(path):
|
|
browser = FileBrowser()
|
|
return browser.get_files(path)
|